Web run notes

 3 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Thuy Thiem
New Member
Posts: 2
New Member

    Good morning,

    I try to extract the invoice attachment (invoice comments), but I get more than I'm looking for.  How can I get just the comment (red line)?  
     

     
     
    Here is the result:

    TITLE=Comments

    D:0=Short paid $ 97.68 per buyer. The PO# set up this item (481-952) @ 16.27 per case. Invoice line#2 not matching to the po cost.

    K:0=K1=0010&K2= 12134&K3=032-272292&K4=000&K5=0000

    R:0=writeattach.exe?_OUT=TEXT&_PDL=PROD81&_FN=APINVOICE&_IN=APISET1&K1=0010&K2=++++12134&K3=032%2D272292&K4=000&K5=0000&_ATYP=C&_AUDT=A&_AK=zF03&_KS=zz&

    C:0:0=ap 7/7 win

    R:1=writeattach.exe?_OUT=TEXT&_PDL=PROD81&_FN=APINVOICE&_ATYP=C&_AK=zF03&_IN=APISET1&K1=0010&K2= 12134&K3=032-272292&K4=000&K5=0000&

    C:1:0=Add

    MSG=Success

    ERRNBR=5000

     

    Thanks!

    Thuy 206-901-4222

    David Williams
    Veteran Member
    Posts: 1127
    Veteran Member
      You should be using a cgi-lawson/getattachrec.exe WebRun call. Once you get this back, you have to parse out the section you want.
      I used B=Cmt.indexOf("AttData") and E=Cmt.indexOf("/AttData") to figure out the beginning and end points and then Cmt.substr(B+23,E-B-32) to clean it up.
      David Williams
      Thuy Thiem
      New Member
      Posts: 2
      New Member
        Good morning David,

        Where should I set up the B and E, in the message builder?

        Thanks!

        Thuy
        David Williams
        Veteran Member
        Posts: 1127
        Veteran Member
          If the variable "Cmt" is assigned to the getattachrec.exe results then Cmt.substr(B+23,E-B-32) would be the value added to the MsgBuilder.
          David Williams