4 Replies Latest reply on Jun 2, 2015 8:49 AM by gkaiseril

    I'm using vbScript to populate a fllable PDF file in Serena Small Business Manager (SBM). It is not recognizing the vbCRLF line feed command. Does anyone have a solution? Perhaps using JavaScript?

    linda hurt

      I'm generating an acknowledgement letter from the app. It'll save over 3,000 hours per year. As I don't know JavaScript, I'm hoping to find a solution for vbScript. Here's the code. If someone knows how to translate it into JavaScript, that would be most appreciated too.

       


      Option Explicit

       

      DIM sal, fName, mName, lName, suf, city, stateID, zip, FOIAspec, fldList, fldObj, Addr1, Addr2, tmp1, tmp2, ltrAttach

      If Ext.ShellHasProp("Item") Then

      '--Read Fields

      Set fldList = Shell.Item.Fields()

      Set fldObj = fldList.FindField ( "SALUTATION" )

      Call fldObj.GetDisplayValue ( sal )

      Set fldObj = fldList.FindField ( "FOIA_SPECIALIST" )

      Call fldObj.GetDisplayValue ( FOIAspec )

      Call Shell.Item.GetFieldValue("REQUESTOR_S_FIRST_NAME", fName)

      Call Shell.Item.GetFieldValue("REQUESTOR_S_MIDDLE_NAME", mName)

      Call Shell.Item.GetFieldValue("REQUSTOR_S_LAST_NAME", lName)

      Call Shell.Item.GetFieldValue("SUFFIX", suf)

      Call Shell.Item.GetFieldValue("STREET_ADDERSS_1", Addr1)

      Call Shell.Item.GetFieldValue("STREET_ADDRESS_2", Addr2)

      Call Shell.Item.GetFieldValue("CITY", city)

      Set fldObj = fldList.FindField ( "STATE_ABBREVIATION")

      Call fldObj.GetDisplayValue ( stateID )

      Call Shell.Item.GetFieldValue("ZIP_CODE", zip)

       

      '--Set fldObj = fldList.FindField("LETTER_ATTACHMENTS")

       

      '--Call fldObj.GetDisplayValue ( ltrAttach )

       

      vbCRLF = chr(13) & chr(10)

      tmp1 = Addr1

      If len(Addr2) > 0 then

      tmp1 = tmp1&"," & vbCRLF & Addr2

      End if

       

      tmp1 = tmp1&"," & vbCRLF & city & ", " & mid(stateID,1,2) & " " & zip

       

      '--Write Fields

      Call Shell.Item.SetFieldValue("REQUESTOR_S_FULL_NAME", fName & " " & mName & " " & lName & " " & suf)

      Call Shell.Item.SetFieldValue("LTR_GREETING", sal & " " & fName &" " & mName & " " & lName & " " & suf&":")

      Call Shell.Item.SetFieldValue("CITY_STATE_ZIP", city&", "&stateID&" "&zip)

      Call Shell.Item.SetFieldValue("FULL_ADDRESS", tmp1)

      Call Shell.Item.SetFieldValue("TEST_ADDR", tmp1)

       

      '--Call Shell.Item.SetFieldValue("LETTER_ATTACHMENTS", ltrAttach)

       

      Else

      Call Ext.LogErrorMsg( "TeamScript error: Shell.Item does not exist." )

      End If