Skip to Content

A2X Web Service: Check if initial request or update of existing BO in event

Dear experts,

we would like to implement some logic in a event for an extension of BO service request. The logic should be dependent if a service request is initially created (ActionCode = "01") or if an already existing service request is updated (ActionCode = "02").

As the value of the action code cannot be accessed from coding in the event itself is there any other recommended approach on how to determine of it is an initial request or update of a previously created object?

Thank you for your advice!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Hi Florian Guppenberger,

    You may use a flag to tell you whether is an update or create of the object. Therefore, when is a create the flag will be initialized as false, in the end of the before-save event you set the flag as true, doing this in the next time you just check this flag again and you will know that is an update.

    Request Action-code 01 -> before-save check if flag is false -> if is false is a create, then do your code for creating -> At the end set it as true.

    Request Action-code 01 -> before-save check if flag is false -> if is not false, is an update, then do you code for updating-> no need to change the flag (you can set is as true again).

    Best regards

    Marlos Damasceno

    Add comment
    10|10000 characters needed characters exceeded