How to change the value of the specific column in the specific row of Line Items from the Advanced Script Rule?

Question

How to change the value of the specific column in the specific row of Line Items from the Advanced Script Rule?

Answer

I.e. there is the Line Items table, and it is required to change the value of the Article Number Vendor column in the 2nd row:

 

  1. Open the Document Skill in the editor.

  2. Right-click the column and go to the column settings:


  3. Click New Rule> Advanced Script Rule.

  4. Please make sure the required fields are added to the script rule settings, and the Changed by the rule option is checked for the column that will be changed:
     
  5. The sample script would be:
    var myTable = Context.GetField("Line Items");

    if (myTable.Instances.length > 1) //making sure there exists the 2nd row
    {
    var tableField = myTable.Instances[1].GetChild("Line Items/Article Number Vendor");
    tableField.Value = "some value"; //assign the value
    }
  6. The result is as follows:

Additional information

AU: Business Rules Automation

EU: Business Rules Automation

US: Business Rules Automation

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.