Friday, August 3, 2012

Sales Table to sales line update

The SalesTable2Line framwork is used in AX to update fields on the SalesLine when the corresponding field in the SalesTable was changed e.g. DevliveryMode. Follow these steps to extend the framework for your own fields.
  • Create a new field in the SalesTable and SalesLine e.g. a SalesNote field
  • Add the field to the FieldGroup HeaderToLineUpdate in the SalesTable
  • Display the new fields in the SalesTable form
  • Delete all records from the SalesTable2LineParameters table
  • Open Accounts Receivable > Settings > Parameter > "Update order line"
  • Extend the SalesTable2LineField.lineUpdateDescription method
case fieldnum(SalesTable, SalesNote): 
    return fieldid2pname(tableNum(SalesLine), fieldNum(SalesLine,SalesNote));
  • Add parm methods for the new field to AxSalesTable and AxSalesLine classes
public SalesNote parmSalesNote(SalesNote _salesNote = “) 
    if (!prmisdefault(_salesNote)) 
        this.setField(fieldnum(SalesLine, SalesNote), _salesNote); 
    return salesLine.SalesNote; 
  • Create a set method in the AxSalesLine class
protected void setSalesNote() 
    if (this.isMethodExecuted(funcname(), fieldnum(SalesLine, SalesNote))) 
    if (this.isAxSalesTableFieldsSet() || this.axSalesTable().isFieldModified(fieldnum(SalesTable, SalesNote))) 
  • Add the call of this set method in the AxSalesLine.setTableFields method


  1. Include the SalesLine.Field in a table field group and assign a group label.

  2. I actually followed each and everything right ,my setSalesNote method is throwing error in last line
    ------> this.parmSalesNote(this.axSalesTable().parmSalesNote());

    error is : wrong number of arguments has been specified for the function.