• Creator
    Topic
  • #4166
    RPP
    Participant

      Hi

      I am trying to write an applet that will ‘tag’ an email with a particular FieldDefinition.

      My code so far is …

      Dim oFieldDef

      On Error Resume Next
      Set oFieldDef = Groupwise.Account.FieldDefinitions.item(“TagLine”, egwString)
      On Error GoTo 0

      If Not IsObject(oFieldDef) Then
      Set oFieldDef = Groupwise.Account.FieldDefinitions.Add(“TagLine”, egwString)
      End If

      Unfortunately I get an error on trying to add the Def as follows :-

      “Unable to create Field Definition in GroupWise Data Store at line 9, column 7”

      Line 9 is my .Add line. I am guessing it fails because the Account object is Read-Only and therefore I am not allowed to add Defs.

      Is there some other way to get to the Account object that would give me read/write access?

      In VB I would do the following …

      Set gwApp = CreateObject(“NovellGroupWareSession”)
      Set gwAcct = gwApp.Login

      On Error Resume Next
      Set gwFldDef = gwAcct.FieldDefinitions.item(“TagLine”, egwString)
      On Error GoTo gbCreateEmailErr:

      If gwFldDef Is Nothing Then
      Set gwFldDef = gwAcct.FieldDefinitions.Add(“TagLine”, egwString)
      End If

      This works in VB but for this Applet I need Formativ to do the creation.

      The first two lines are the crucial bit, they get me the Account object. I’ve tried creating the object that way within Formativ (which appears to work) but I get the same error back

      Simon

    • Author
      Replies
    • #7328
      MA
      Participant

        The user-defined field type constants egwString in formativ is fgwString Wink. See the Formativ language guide for more details. The code below works for me. Hope this helps.

        Dim oFieldDef

        On Error Resume Next
        Set oFieldDef = Groupwise.Account.FieldDefinitions.item(“TagLine”, fgwString)
        On Error GoTo 0

        If Not IsObject(oFieldDef) Then
        Set oFieldDef = Groupwise.Account.FieldDefinitions.Add(“TagLine”, fgwString)
        End If

        [This message was edited by Support 1 on October 11, 2005 at 04:35 PM.]

        #7329
        Support 1a
        Participant

          Thanks for the hint MA.

          Advansys Support

          #7330
          RPP
          Participant

            Doh! Thanks for that guys – it now works!

            On a related problem, is it possible to assign a user-defined field to all copies of an email?

            To explain a bit further, we get emails that come in to multiple people but I want to handle them as one email.

            The CommonMessageID is the same for these messages although the MessageID is not.

            What I need to do is add a user-defined field to the ‘common’ message so that each user’s Groupwise can tell when somebody else has processed the message.

            Have tried getting the message based on the CommonMessageID but it won’t let me add the Field to that message (at least I don’t think it will)

            Any ideas?

            #7331
            MA
            Participant

              quote:


              On a related problem, is it possible to assign a user-defined field to all copies of an email?


              See the code below to add user-defined field to a GroupWise message. Hope this helps.

              dim oMsg
              dim oField

              On Error Resume Next

              set oMsg = nothing
              set oMsg = Client.ClientState.CommandMessage

              ‘ Access the user-defined field
              set oField = nothing
              set oField = oMsg.Fields.Item(“TagLine”, fgwString)

              ‘ If user-defined field assigned then display the value otherwise assign new value.
              ‘ You can also update existing user-defined field value.
              if not oField is nothing then
              msgbox “Existing value: ” & oField.value
              else
              msgbox “Setting user-defined field value”
              call oMsg.Fields.Add(“TagLine”, fgwString, “Field value”)
              end if

              set oField = nothing
              set oMsg = nothing

              #7332
              Support 1a
              Participant

                Thanks MA.

                Advansys Support

                #7326
                RPP
                Participant

                  MA – Sorry if this sounds ungrateful but that’s not what I asked for. I have already worked out how to add a User-Defined Field (UDF) to a particular ‘local’ email and its very handy.

                  Support – Please can you check that the query has been correctly answered before moving on. I’m in the UK so each question takes 24hrs to get an answer due to the time zone difference. Bit frustrating to lose a day this way.

                  Rant over

                  What I need to do now is make that field available to all users who received a copy of a particular email.

                  For example –

                  An email comes in from our client, Colin, say, and he has sent to two employees here – Eric and Ernie.

                  If I run an applet on both Eric and Ernie’s mailboxes then I can see that each user’s mail has a different MessageID but they have the same CommonMessageID

                  Let’s say, Eric reads and deals with the email. I need to give him an applet button that will mark the email as handled. The button bit I can do and I can ‘tag’ his copy of the email as ‘done’ easily enough. That would at least stop him processing that one again.

                  What I can’t seem to do is mark the underlying ‘common’ message such that Ernie’s mailbox will also know that Eric has handled it. Attempting to add a field to “oMsg” where oMsg is retrieved using the CommonMessageID doesn’t work. It says it is read-only (i definitely have the right ‘fgw’ constant this time!)

                  Just to complete this scenario – Eric and Ernie don’t get on so they aren’t going to allow proxy read or write rights over each other’s mailboxes nor will they give me their passwords so I could use a multi-login to get directly to their mailboxes from my applet.

                  Thanks

                  Simon

                  #7327
                  Support 2
                  Moderator

                    RPP,

                    Thank you for your post. Our tests show that accessing a message via the CommonmessageID property results in a read-only instance of the message. This appears to be consistent whether you access the message via Multi-login, proxy or directly (i.e. by logging into the account directly). This is very likely the reason why you cannot add a custom defined field to the message.

                    We appreciate that it is frustrating to have project development stall due to an apparent technical roadblock beyond your control. With this in mind we always do our best to be responsive to Formativ specific questions. However, as you may be aware, your last question relates directly to the Novell Object API. While you can access the Object API using Formativ, as you can from any other compatible development environment, it is not part of Formativ. If you require time critical answers to Novell GroupWise Object API programming questions, you may wish to investigate the support options offered by Novell. See http://developer.novell.com/wiki/index.php/Developer_Support for details.

                    Regards,

                    Advansys Support

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