Question

Automatically add document text to PO header

  • 11 July 2023
  • 1 reply
  • 102 views

Userlevel 4
Badge +9
  • Sidekick (Customer)
  • 58 replies

Hi All,

We have a standard document text for the PO to be added to the Document at print. In some use cases the user will want to edit the text for a given PO which is not possible from the PO. To solve for this, I would like to add the Document text as the PO Header Text by default for every PO. This will allow the user to make any edits they need without the risk of having a blank header text printed on the PO. However I have been unsuccessful getting a custom event to work. I tried using the API  Document_Text_API.New_Note_Text but it does not seem to be working. Any suggestions? Thanks.


1 reply

Userlevel 2
Badge +8

Hi,

 

One way to achieve this is to add a custom event on the PurchaseOrderLinePart LU, for the PURCHASE_ORDER_LINE_TAB table to fire when a new object is created. Also make sure to tick the ORDER_NO, New Value attribute in the list.

 

Then add an event action where the “Perform upon Event” field matches the “Event ID” field above. This should be of type “Execute Online SQL” and run the code in the image below.

 

This will mean that each time the first part order line of the PO is created it will add in a note text to the PO Header with the type and value specified in the document_text_output_type_  and document_text_phrase_  parameters in the code above.

Regards

 

Telha

Reply