Symptom
You have tried modifying few fields in the AddressInformation tab but the AfterModify event is not getting triggered even though the fields are in the same BO node.
Environment
- SAP Cloud Applications Studio
- SAP Cloud for Customer
Reproducing the Issue
- Login to Cloud Applications Studio.
- Open the solution and navigate to the relevant path.
- Put a breakpoint in the AfterModify event of AddressInformationnode from Customer BO.
- Login to UI.
- Navigate to Customer work center.
- Open any account and switch to Addresses tab.
- Try to modify some standard address-related fields like Postal Code, Street, House Number, etc.
- You can see that the debugger is not hit in the event AfteModify.
- Also, the script is not triggered when updating the field on the account Quick Create (QC) screen.
Cause
A script on a node will only be called if fields of that node are changed or the association from that node is changed.
The data that you see on an account comes from a combination of different Business Objects (BO) + Dependent Objects (DO) in the backend. Address information itself is a regular node on the Business Partner BO. It doesn't hold any real Address information but holds just a pointer and data values to the actual DO (address snapshot) where the real address is stored.
When you do an update, changes are done to the snapshot but no changes are done to AddressInformation node as nothing relevant to this has changed i.e. it still points to the same snapshot instance. Hence, updating address will not call the AfterModify of AddressInformation node.
Resolution
You can create a BeforeSave event on AddressInformation node, which will then get triggered on save of the account, if address-related fields are changed.
Alternatively, if you want to have some logic which checks whether AddressInformation is filled, you may create an AfterModiffy script on Common node and once fields under this node (for example standard field Name or an KUT/PDI extension field) is updated, it will be executed.
Keywords
PDI, SDK, script, modifying, phone, number, does, not, trigger, event, after, modify, e-mail, e-mail, address, information , KBA , address node , event after modify not triggered , address information node , LOD-CRM-ACC , Account , AP-RC-BDS-SCR , ByDesign Studio Scripting (ABSL) , How To