/ Forums / Advansys Formativ / Creating Solutions with Formativ / Double Quote Problem with ItemSetText

  • Creator
    Topic
  • #4220
    rdryan
    Participant

    I’m attempting to insert an applet scripted text message at the beginning or top of the message body prior to sending an email. I’m having a problem with all double quotes inserted in the manually entered portion of the message body. I’m basically attempting code that strings our custom message followed by the string value from GroupWise.ComposingItem into the ItemSetText fieldtext argument. The ItemSetText method appears to convert double quotes in the “fieldText string replacement” into two double quotes – “this” gets replaced with “”this””. I’ve tried to replace ” with Chr(34), but even Chr(34) gets converted to “”?

    Any sample solutions or ideas are greatly appreciated.

  • Author
    Replies
  • #7522
    Support 3
    Participant

    Hi rdryan,

    The defect actually lies in the Formativ GroupWise.ItemSetText() command. We will fix this issue in the next maintenance release. In the meantime, you can work around the bug by using ThrowToken method as shown here:

    iText = “Double quote(“”””).”
    iSyntax = “ItemSetText(“”X00″”;10;””” & iText & “””;1;1)”
    msgbox groupwise.throwtoken(iSyntax, iReturnVal)

    The ThowToken method calls the native GroupWise token directly, and returns a boolean indicating if the token actually worked. See the Formativ Language Guide for more information.

    Hope this helps.

    Regards,
    Advansys Support

    #7520
    rdryan
    Participant

    Your solution worked perfect. I think it’s safe to say that I would not have found this on my own.

    Thank you,
    rdryan

    #7519
    Support 3
    Participant

    Thanks for the feedback.

    Regards,
    Advansys Support

    #7525
    rdryan
    Participant

    I have another question. All message body characters work with the “ThrowToken” method except for open and close parenthesis “()” and curly brackets “{}”. Any of These result in a “false” return and my applet fails to work. Would you have some ideas on how to keep these characters in the message body when converting to a string with GroupWise.ComposingItem and putting the message body back into GW with the “ThrowToken” method? Thank you!

    #7523
    Support 3
    Participant

    Hi rdryan,

    Could you please provide some sample code as we could not reproduce the behaviour. The sample code below uses the ComposingItem and ItemSetText token to insert the characters you described above.

      GroupWise.ComposingItem.bodytext = "(), {}"
    
      iText = "(), {}"
      iSyntax = "ItemSetText(""X00"";10;""" & iText & """;1;1)"
      msgbox groupwise.throwtoken(iSyntax, iReturnVal)
    

    Regards,
    Advansys Support

    #7521
    rdryan
    Participant

    Thank you for your response. Here is the applet I’m using:

    ‘——————————————————————————-
    ‘ 3/1/06 rdr Created
    ‘ Allow email sender to insert a standard customer warning message on top of
    ‘ the composing message body to warn recipient not to send sensitive personal
    ‘ information via email
    ‘——————————————————————————-

    Sub Main(Client, GWEvent)
    Dim Msg
    Dim textLine
    Dim textMessage
    Dim StrMsg
    Dim StrNewMsg

    textLine = “________________________________________________________”
    textMessage = “For future reference, to protect the confidentiality of your”_
    + ” financial information, please do not include personal ” _
    + “information such as account numbers, card numbers, or ” _
    + “social security numbers in email messages. Regular email ” _
    + “messages are not secure and therefore should not be used ” _
    + “to communicate confidential information. “

    Set Msg = GroupWise.ComposingItem

    if (not Msg is Nothing) then
    strNewMsg = textLine _
    + vbCRLF + vbCRLF + textMessage + vbCRLF _
    + textLine + vbCRLF + vbCRLF + Msg.BodyText
    iSyntax = “ItemSetText(“”X00″”;10;””” & strNewMsg & “””;0;1)”
    msgBox groupWise.throwToken(iSyntax, iReturnVal)
    ‘call GroupWise.ItemSetText(“X00”, itfMessage, strNewMsg, false)

    Set Msg = nothing
    else
    MsgBox(“no gw items were available to insert text”)
    end if

    End Sub

    You’re right that the test you describe above works well. In fact, I’m more puzzled now. For some reason though, if you type the (), {} within the message body, Msg.BodyText with throwToken’s iReturnVal comes back false and the applet fails.

    Thanks for your ideas,
    rdryan

    #7524
    Support 3
    Participant

    The sample code above works fine with or without (), {} in the textMessage variable. May be the issue is relate to the GroupWise version. We have test the sample code in GroupWise 6.5.6 (1/02/2006 build) client. Which versions of GroupWise are you using (See Help – About GroupWise)?

    How do you execute the applet? We have execute the sample applet from the composing message toolbar. If you do not have a valid composing message then the Token will not execute and the return value will be FALSE.

    Hope this helps.

    Regards,
    Advansys Support

    #7527
    rdryan
    Participant

    Thanks again for responding.

    It may well be that we’ll need to upgrade GroupWise. We’re on 6.5.1 (7/11/2003 build) which is a bit behind. I’m running this via a Message Tool Menu option. It does work every time unless () or {} are in the message body.

    I’m happy to know that it can work.

    #7526
    Support 3
    Participant

    Hi rdryan,

    We are not sure why the ItemSetText token works differently in your GroupWise client if (),{} are in the message body. This Token works fine in here with or without (),{} in the message body. The sample applet works fine from the message toolbar and Tools menu.

    We will recommend to upgrade your GroupWise client. Please do not hesitate to contact us with further comments or requests.

    Regards,
    Advansys Support

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