URL Attachment from batch program

 7 Replies
 0 Subscribed to this topic
 1 Subscribed to this forum
Sort:
Author
Messages
Thomas Busillo
New Member
Posts: 3
New Member
    I am looking for a way to add URLs to invoices. The URL will be from from a separate program that will generate the URL.

    Is there a way to put it in a batch program with some other identifying information, like invoice number and company number, that will attach it to the URL field in Lawson?

    Is there a batch program that has like a CSV file that we can use to attach the URL to an invoice?
    John Henley
    Posts: 3353
      I'm assuming you're talking about AP invoices, but I've used the same technique for both AR and AP invoices:
      -For AR (AROIHDR), turn on URL attachments via dbdef and add a URL to screen rules
      -Write a batch loader to read from either a custom table or a CSV file, which contains Co., Invoice, keys as well as URL/UNC file location; uses standard Lawson attachment APIs (so attachment viewing works in LID and Portal)
      -Also create similar form program which allows loading via on-line and/or MS addins
      One caveat: For the AROIHDR dbdef change, since you would be "customizing" the database by turning on attachments, this is a customization that needs to be handled carefully during an upgrade.
      Thanks for using the LawsonGuru.com forums!
      John
      nlmoran
      Veteran Member
      Posts: 53
      Veteran Member
        I have a batch program that reads Apinvoice table selects invoices
        based on Invoice create date and builds the URL for each invoice for our Imagine System.
        This program also uses the Standard Lawson attachment APIs.
        I have done this for invoices. payroll,general ledger,fixed asset,
        working on Vendor Agreements and Purchace Orders
        rhodge
        New Member
        Posts: 2
        New Member
          We are adding an invoice using an AGS call, can we specify an URL attachment in that call as a parameter? If not, is there another AGS call or other API call that will add the URL attachment to the invoice after it is added?
          John Henley
          Posts: 3353
            You want to use the 'writeattachrec.exe' cgi program after you've interfaced the invoice.

            Here's a sample call for a purchase order:

            http://IOSserver:port#/cg..._OUT=XML&_PDL=DEV802
            &_FN=PURCHORDER&_IN=PCRSET1&K1=4321&K2=&K3=%20%20%20%20%20%20%20%20%20%20%20100
            &K4=0000&_ATYP=C&_AUDT=I&_USCH=none&_DATA=TRUE&&_OPM=M&_ECODE=FALSE&_ANAM=test2
            &_ATXT=this%20is%20a%20test%20for%20writeattach

            You'll need to change &_FN=APINVOICE, &_IN=APISET1, fill in the Kx= parameters to match the key structure for the invoice. Also, &_ATYP=U (URL) and &_USCH=http.
            Thanks for using the LawsonGuru.com forums!
            John
            rhodge
            New Member
            Posts: 2
            New Member
              Thanks alot! that worked great!
              blong
              Advanced Member
              Posts: 21
              Advanced Member

                We have a document imaging system that contains AP Invoice images.  We can query the attributes associated with those invoices (company, vendor, invoice_num, etc.) and gather the information necessary for a writeattach.exe call to insert a URL attachment to an invoice in Lawson.

                I have logged into Portal via IE and manually called the writeattach.exe by building the string myself and inserted a URL attachment.

                I am looking for suggestions on how to automate the execution of this writeattach.exe program.  Is this something you would normally do through Process Flow or IPA?  We currently do not utilize Process Flow.

                Thanks!!

                John Henley
                Posts: 3353
                  Are the invoices entered into AP directly or via an interface?
                  Thanks for using the LawsonGuru.com forums!
                  John