Header2Line functionality : Adding an extra field

It is possible to update fields on the purchase lines when the according field on the purchase header record changes. When you want to add a field to this functionality, this is what you need to do to make it work : 

  • Add the field to the Header2LineUpdate field group
  • HeaderToLineUpdate fieldgroup

     

  • Add field in the method LineUpdateDescription in the class PurchTable2LineField. This will take care of the text on the update parameters form.
  • Class : PurchTable2LineField, Method : LineUpdateDescription

     

When this is done, you should see the  field appear on the form with the update parameters. But if you called this once before, the map of fields will be stored in the usage data and therefore the table containing the chosen parameters will not contain the new field until you do one of the following : 

  • Call the initiate method on the PurchTable2LineParameters table. Also, you either have to delete the records in the table or skip the check if the parameters are already initiated if you want to keep the already setup values.
  • Initiate parameter records

     

  • Or erase the usage data and it will be initiated automatically (Also delete the records in the table of the check will return true that the records are already initialized.)

The result is that you have your field on the parameter form. (in my case here I added the transport field and also did some extra modification to the dialog to add 4 extra fields in one group, but this is not in scope of this post) 

Update parameters form