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

2 thoughts on “Header2Line functionality : Adding an extra field

  1. Hi
    I also want to apply the same functionality.
    I want a group which contain the two field ( values to be updated like dimension )
    with the above modification i had also modified the AXPurchTable,AxPurchLine classes with set and the parm method but still i am not getting the proper result.
    I am getting the prompt also but my values are not getting updated.
    can you suggest me where i am lagging..?

  2. Not sure if you have done this, but can you make sure you have deleted all the records in the PurchTable2LineParameters and let them recreate by executin the initiate function on that table ? If it went fine, you should see the new fieldnumbers of the two new fields in there.

    If not, let me know and we can do some further investigation or you could send me the code you have in an xpo and I will have a look at it for you if you want.

Leave a Reply

Your email address will not be published. Required fields are marked *