/ Forums / Advansys Formativ / Creating Solutions with Formativ / EmailAddress from ProxyAccount

  • Creator
    Topic
  • #4038
    rfaude
    Participant

      Hi Support,

      i have UserA and UserB. UserB granted UserA full proxy rights. The full email address from
      UserA be UserA@hr-online.de and from UserB be UserB@you-fm.de.
      The applet should compare the internetdomains and do different worksflows.

      i use the following applet


      Sub Main(Client, GWEvent)

      Dim Msg

      GroupWise.NewMail

      Set Msg = GroupWise.ComposingItem

      x = Msg.sender

      y = GroupWise.Account.Owner.EmailAddress

      msgbox x
      msgbox y

      End Sub

      In the mailbox of UserA it displays the correct Sender Name and EmailAddress. When i switch to UserB via
      Proxy access the eMailAddress is always from UserA and not from UserB.

      How can i read the EmailAddress (UserB@you-fm.de) from UserB when i do a proxy access from UserA?

      Thanks for help …

      Ralf

    • Author
      Replies
    • #6920
      Support 1
      Participant

        The object GroupWise.Account refers to the root account (the logged-in user), regardless of whether proxying to another account.

        To obtain a reference to the proxy account object, use either the Application object from the GroupWise Object API, documented here, or the ClientState object. The following code examples show how to do this with Formativ.

        ' This example assumes the collection .ProxyAccounts contains exactly one item,
        ' and that GroupWise has been *programmatically* proxied to only one account.
        Sub Main(Client, GWEvent)
        
           Dim x, y
           Dim oAccount
           Dim oMsg
        
           ' Programmatically proxy to another account:
           'set oAccount = MultiLogin(...)
        
           GroupWise.NewMail
           
           Set oMsg = GroupWise.ComposingItem
           
           x = oMsg.sender
           
           Set oAccount = GroupWise.Session.ProxyAccounts.Item(1)
           y = oAccount.Owner.EmailAddress
           
           msgbox "Sender: " & x & ", EmailAddress: " & y
        
           Set oMsg = nothing
           Set oAccount = nothing
           
        End Sub
        ' Client.ClientState.CurrentAccount gives you an instance of the account that was
        ' proxied to using the GroupWise UI.  The email address of the proxied account
        ' can be accessed thus:
        Begin Sub Main(Client, GWEvent)
        
          MsgBox Client.ClientState.CurrentAccount.Owner.EmailAddress
        
        End Sub

        I hope this helps.

        Advansys Support

        #6924
        rfaude
        Participant

          Hi,

          i use Client.ClientState.CurrentAccount.Owner.EmailAddress and this works great.

          Where can i find information about Client and Clientstate? I read in the Object API docu but i cannot find it. Can you give me a hint!

          Thanks

          Ralf

          #6921
          Support 1
          Participant

            Thank you for you query.

            Client is the first parameter of the Main subroutine in every Formativ applet. Here is a quote from the Formativ Programmers Guide:

            quote:


            This parameter represents the state of the GroupWise client at the time your applet was executed. It is the same as the GroupWise C3PO ClientState Object as documented in the GroupWise C3PO documentation.


            You will find more information in the Programmers Guide on the properties and methods of Client.ClientState.

            I hope this helps.

            Advansys Support

            #6925
            Support 1a
            Participant

              You’ll find the ClientState documentation here.. This is the implementation object. It’s parent object also exposes a couple of methods that may be useful.

              Advansys Support

              #6923
              rfaude
              Participant

                Ok, i found the documentation. Maybe in the DHO-Session on BrainShare the Crocodile Men teach a little bit about the GroupWise C3PO ClientState Object.

                Thanks …

                Ralf

                #6922
                Support 1a
                Participant

                  The contents of the session is being finalized next week, so I’ll see if some information on the clientstate object can be included.

                  Thanks for the feedback.

                  Advansys Support

                Viewing 6 replies - 1 through 6 (of 6 total)
                • You must be logged in to reply to this topic.