How to add an Invoice Number to the batch name?

Question

Could you please let know can we add invoice number on verification station in Batch Type tab.

Answer

The batch name could be changed using a Processing script.

It can be added when creating an Automatic batch processing stage in the Advanced mode of the Workflow setup:

Image_003.png​​

The following script should be used to replace the name of the Batch with the Invoice Number:

using System;
using System.IO;

Batch.Name = Documents[0].Field("Invoice Layout\\InvoiceNumber").Text;

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request

Comments

5 comments

  • Avatar

    Ivan Skoritzky

    Hello Blake,

    It looks like the syntax error. You can submit a ticket to our support team and provide with a project sample on which the issue occurred.

    0
  • Avatar

    Anne Howie

    Could this be used to rename the batch with supplier name? Or even name it both supplier name AND invoice number? If so, how would the script be modified pls?

    Does this get added to it's own stage in the workflow or to a specific stage?

    0
  • Avatar

    Anne Howie

    Hi Ivan, that works perfectly! Thank you so much.

    0
  • Avatar

    Ivan Skoritzky

    Hello Anne,

    ("Invoice Layout\\InvoiceNumber")

    This particular field link is responsible for the value of a name. So, you can replace it with any other link to the field. 

    For the Vendor name, the script will be 

    using System;
    using System.IO;

    Batch.Name = Documents[0].Field("Invoice Layout\\Vendor\\Name").Text;

    For Vendor Name + Invoice Number:

    using System;
    using System.IO;

    Batch.Name = Documents[0].Field("Invoice Layout\\Vendor\\Name").Text+" "+Documents[0].Field("Invoice Layout\\InvoiceNumber").Text;

     

    0
  • Avatar

    Blake Smith

    The above instructions don't work when I follow them. I'm using FC 12.0.3.4053. When adding the script to the Script Editor and then click the 'Check' button, it gives the error "Expected ';' (line 1, pos 7)".

    0

Please sign in to leave a comment.