BOI - Bypass Separate Check Popup

SOLVED

I'm working on a BOI script to create Manual Check entries from a CSV. 

Everything can import successfully, except when the invoice was set with SeparateCheck = "Y". In regular UI, you get the popup message "The Invoice ____ is flagged for separate check. Do you want to continue? Yes/No".

I would like my BOI script to answer Yes and allow the InvoiceNo to be paid -- is this possible in BOI? The message occurs when I run an oLines.nSetValue for the InvoiceNo.

Thanks!

Top Replies

  • 0

    When the SetValue() returns a -1 (warning) the script can just treat that as if a 1 (success) was returned and continue forward.

    In the Sage 100 UI for Manual Check when the warning is encountered and the message is popped up about separate check, if Yes is chosen the UI just continues on.  It is only when No is selected that some extra work is done to delete the invoice line from the manual check entry.

  • 0 in reply to Steve Passmore

    Thanks Steve. Do you know what function or command you would use in a BOI script to treat the warning as a 1 instead of a -1? I am not finding a way to trigger a "Yes" answer -- since we don't answer the message, I'm not able to write the InvoiceNo.

  • 0 in reply to JasonKonopack

    Can you provide more information about your script?  Where does it get executed from?

  • 0 in reply to Steve Passmore

    Script is external to Sage and when finished will be triggered by Windows Task Scheduler to scan a directory for CSVs and import them.

  • 0 in reply to JasonKonopack

    With BOI using the business objects for Manual Check Entry there will be no message prompt, that is done in the Sage 100 UI object only.  The business object will return the warning and it is up to the UI or in your case your script to do something.  Since you want to just accept the invoice that is flagged for a separate check just let the script continue on. 

    If your script has coding that is checking for the response from the business object when you do the SetValue() for the InvoiceNo$ field you can treat a return value of -1 (warning) the same as 1 (success).  If you want, the script code can ensure that the separate check issue was the specific warning by checking that the LastErrorMsg$ property has a value of "AP_InvoiceSepCheck.Y", or better yet, since there could be multiple warnings found, the script can check the ValidationMessageQueue$ property to see if "AP_InvoiceSepCheck.Y" is one of the warnings.

  • 0 in reply to Steve Passmore

    Thanks Steve. Yes I'm already pulling LastErrorMsg$ and just now checked ValidationMessageQueue$, both point to the Separate Check msg and only that. I've set up the situation in a test environment to be exactly that (SeparateCheck = "Y" in AP_OpenInvoice).

    I'm getting a return value of -1 and can successfully skip the record and continue with the script, but that doesn't get Sage to accept the invoice, since I'm not able to provide it with an answer ("Do you want to continue?" "Yes").

    I am trying to see if DeactivateProcedure() would work in this case, haven't got the syntax to work in PowerShell just yet.

  • +1 in reply to JasonKonopack
    verified answer

    , when you get the return value of -1, it has successfully set the invoice.  So you should not need to do anything else.  We use the -1 to indicate that the field was set successfully, but there is a message that can be displayed.  (This is the "Do you want to continue?" question.)  So you should be able to continue to process that invoice just as if you received a return value of 1.

  • 0 in reply to jepritch

    Thank you! I found a mistake in the script where I was not writing the Manual Check entry due to the return value being -1. Working now.