on 06-09-2016 12:26 PM
Dear Experts,
How can I check from code if the user has only edited the sales order item node and not the save is fired from after modify event?
Iam using Event after modify .But this event is fired in all cases including edit , save , release , etc... As I need to apply my logic in Event after modify only on the time user changes the sales order and not on other actions.
How is this possible.
Thanks ,
Resmi
Hi Resmi,
From what I understood, you like to know whether an business object has been modified but not yet saved.
I do not see a way how to distinguish modifications triggered immediately prior to saves from others.
So maybe what you intend to achieve can be reached in a different way?
In order to be able to give some better suggestions, could you maybe elaborate on what your use case is without already having a specific way of implementation in mind?
Best regards,
Ludger
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Below is my scenario:
I have extended sales order item node to have a new discount field.Total of these discounts will be added to Sales order discount .
This item discount is calculated based on some rules (depends on product id, weight, account etc...). So the code is added in Event After modify.
We need to run this rules at every step till its approved if any new item is added or modified.
Now the issue is When I click on button Submit -> Release Order it says the message 'Changing data not possible; data is read-only' .
I know the reason as event after modify is trying to change a released item node which system doesn't allow.
But some way I need to figure out the solution .So what I thought is if user does a release ,approve etc, the code inside the AfterModify event should not execute. That is the reason I was asking by any way with Status I can accomplish this.
Any help .
Thanks,
Resmi
Dear Pradeep,
Thanks for the suggestion.This helped after the SO is released.
But for the scenario when SO is in preparation and I clicked on submit ->Release status is not yet released, the After modify event is fired.I need to identify a status to check if this aftermodify event is fired on click of Submit->Release.
This is creating a big show stopper for us to continue.
Thanks,
Resmi
Hello Resmi,
Try to implement your code in Sales Order > Item > beforeSave event to isolate it. But any modification on the item may trigger Sales order events as well.
Best regards,
Alexandre.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Resmi,
There are 3 events
HTH,
Horst
User | Count |
---|---|
89 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.