on 11-05-2014 4:10 PM
Hello Community,
in order to define some smart tracking change actions on some of the Cloud for Customers Entities (like the Accounts and the Contacts), we defined a new implementation of the BeforeSave Event Handler on an Extension for the C4C Business Object BusinessPartner.
Suppose that the BeforeSave Event Handler has been triggered by a change on the Account Name (or any Common Data). In this case, is it possible to acquire (in the event handler ABSL code) both the Old and the New value for the changed fields?
As far as we check the BO data on the Event Handler code, it seems that just the updated values are visible, and that the old ones are lost. Could you please confirm this behavior or suggest any work-around (if present)?
Thanks a lot,
Davide
No, this is not possible.
What you have to do, is the following (for each field you are interested in):
1, store the last saved value in a custom field
2. upon save, compare the current value with the last saved value.
if there is a change:
3. Run your custom code
4. restart with 1.
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.
Another approach would be creating a new custom BO called "Logger" or something like that. 🙂
Then you can store all the changes there and query when required.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Fernando,
we realized a little logic where the initial value of a field is tracked with a Change Log Business Object.
Then, everytime the BeforeSave Event Handler is called, the current value is compared with the latest value in the Change Log entries list. If it is different, a new value is stored. The final effect of the Change Log is shown in the picture below:
In the next days we will probably upload a blog article on the solution built.
Kind regards,
Davide
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.