Solved

Modifying a custom field from an event on the base logical unit

  • 10 January 2022
  • 1 reply
  • 455 views

Userlevel 1
Badge +2

Hello, I have a custom field on the “Mixed Payment” logical unit.

I have an event that triggers when a mixed payment is changed. What would be the best practise to edit a custom field tied to this same mixed payment that is being changed ?

From what I could find, I can update the custom field via the MIXED_PAYMENT_CFP package calling the mixed_payment_cfp.cf_modify__ method.

However, I need to provide the OBJID field of the mixed payment, which isn’t available part of the event attributes. As a work around, I am getting the OBJID with a cursor and passing it to the modify which then caused mutating table errors.
I went around it using the instruction “PRAGMA AUTONOMOUS_TRANSACTION” but I was wondering if there was a better way? I am on apps9.

icon

Best answer by Charith Epitawatta 10 January 2022, 23:47

View original

1 reply

Userlevel 7
Badge +31

Hi @jdorval,

Have a look at following thread about pretty much the same topic, which basically discusses about using background jobs and autonomous transactions to achieve this:

Hope this helps!

Reply