Scripting

  • 1.  BOI app against 2016.04 standard entering AR invoi

    Posted 08-30-2017 05:52
    BOI app against 2016.04 standard entering AR invoices. File layout say the KPRIMARY:InvoiceNo & InvoiceType. Code: retVal = AR_Invoice_bus.nSetKeyValue(""InvoiceNo$"", sInvoice) 'retval = 1 retVal = AR_Invoice_bus.nSetKeyValue(""InvoiceType$"", sInvType) 'retval = 1 retVal = AR_Invoice_bus.nSetKey() 'retval = 2 AR_Invoice_bus.sLastErrorMsg = ""The Invoice no. - is invalid"" Happens with multiple invoice numbers, all of which work in the UI or via VI. Is there some other field that needs to be included in the key, despite what the file layout doc says? Or some other problem?


  • 2.  RE: BOI app against 2016.04 standard entering AR invoi

    Posted 08-30-2017 06:01
    I can't get to my file layouts at the moment, but isn't there a SeqNo?


  • 3.  RE: BOI app against 2016.04 standard entering AR invoi

    Posted 08-30-2017 06:15
    try cstr(sInvoice) and zerofill if numeric value


  • 4.  RE: BOI app against 2016.04 standard entering AR invoi

    Posted 08-30-2017 06:23
    The sequence number only appears in history. Invoice numbers are already strings zero-filled to 7 characters.


  • 5.  RE: BOI app against 2016.04 standard entering AR invoi

    Posted 08-30-2017 06:58
    How do you have AR_Invoice_bus defined?


  • 6.  RE: BOI app against 2016.04 standard entering AR invoi

    Posted 08-30-2017 08:04
    Dim AR_Invoice_bus as Object ... AR_Invoice_bus = oPVX.NewObject(""AR_Invoice_bus"", oSS)


  • 7.  RE: BOI app against 2016.04 standard entering AR invoi

    Posted 08-30-2017 08:36
    Batching enabled?


  • 8.  RE: BOI app against 2016.04 standard entering AR invoi

    Posted 08-30-2017 08:46
    Yes, and it gets a batch number successfully and the batch is there after the program errors


  • 9.  RE: BOI app against 2016.04 standard entering AR invoi

    Posted 08-30-2017 08:49
    If you're getting retVal = 2 then you are creating a new invoice. Isn't that what you want? Maybe the LastErrorMsg is a ""false positive.


  • 10.  RE: BOI app against 2016.04 standard entering AR invoi

    Posted 08-30-2017 08:50
    Yes what Mike just said. It may just be the current LastErrorMsg but you can at this point do your nSetValue's


  • 11.  RE: BOI app against 2016.04 standard entering AR invoi

    Posted 08-30-2017 09:13
    Well...duh...Thank you @MichaelNottoli and @AlnoorCassim ! Is there anything that documents what calls return something other than 1 for success?


  • 12.  RE: BOI app against 2016.04 standard entering AR invoi

    Posted 08-30-2017 11:24
    Also be sure your invoice-type field is valid.