Skip to Content

How to get PO id from Validation: OnSave event

Dear Experts,

Below is my scenario:

I am triggering an external webservice in the event Validation: OnSave of purchase order which will be created on release of sales order .

I need to pass the purchase order Id to the web service parameter .So I added the code as below in Validation: OnSave event :

Request.request.PurchaseOrderId = _this.ID.content;

But _this.ID returns value as "##2".

What is this and how to pass PO id .



Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Mar 16, 2017 at 12:47 PM

    Hello Resmi,

    I guess the ID is only finalized during the internal Save process.

    What is the value in the event "BeforeSave"?

    . Horst

    Add comment
    10|10000 characters needed characters exceeded

    • Hello Resmi,

      But I assume the UUID is valid?

      In this case it is possible that you create a "shadow" BO whic has nothing inside than the UUID of the Purchase order and an action to trigger the Web Service.
      After the successfull triggering the BO instance deletes itself.

      Then you can define a MassDataRun with a short cycle on this shadow BO which calls this action.

      . Horst

      BTW: It is a not-so-good practive to call a Web Service in a BeforeSave event as the waiting for the WS call slows down the peformance of the save. Better do it afterwards and asynchronously.