How to access specific columns of the Line Items in the Invoice document definition

Question

 

How to access specific columns of the Line Items in the Invoice document definition in the export script?

 

Answer

The columns can be accessed as follows in the export script: 

Document.Field("Invoice Layout\\LineItems").Items[<instance_id>].Field("<FieldName>");

 
For example, the following C# export script will log the value of the Order Number in the first row:

var myTable = Document.Field("Invoice Layout\\LineItems");

var tableField = myTable.Items[0].Field("OrderNumber");
Processing.ReportMessage("table field value: " + tableField.Value);

Have more questions? Submit a request

Comments

1 comment

  • Avatar

    Ranjit Nayak

    Hi 

    Can someone help me on this. I want to check sum of linetotal of each line and compare with invoice total. Can someone guide, how to take this.

    TIA

    0

Please sign in to leave a comment.