SAP Knowledge Base Article - Public

2612259 - You Want to Use OData Notifications to be Notified When a Contact is Changed

Symptom

You want to create a new OData notification, to be informed when a Contact is changed in the system.

You have setup the notification using the BO BUSINESSPARTNER, CONTACT or CONTACT_PERSON, but the notifications are not triggered.

Also, the ChangedOn attribute from these BOs is not changed.

Environment

SAP Cloud for Customer 1802 and higher.

Reproducing the Issue

  1. Go to the Customers work center and access the view Contacts;
  2. Search for contact XXXXXXX and open it; (XXXXXXX represents the ID of the Contact)
  3. Click on Edit, change the email ID and click on Save, then go to the Changes tab, the change is properly displayed here;
  4. Execute the following OData call: https://myTTTTTT.crm.ondemand.com/sap/byd/odata/v1/c4codata/ContactCollection?$filter=ContactID eq 'XXXXXXX', here the TTTTTT represents the number of the tenant URL;
  5. The ChangedOn field does not have the same time stamp from the Changes tab, also, the notification is not triggered.

Cause

The ChangedOn property on the c4codata service will not be updated, as it is a cross-BO (it is part of multiple objects), so changing its value in the UI will not update the value in the OData property.

Resolution

You need to create a new custom OData Service to fulfill this requirement.

The custom OData needs to be created on the BO BusinessPartner and add the property LastChangedOn. This can be achieved by using the following path in the custom OData:

DefaultIsContactPersonForBusinessPartnerRelationship --> SystemAdministrativeData --> LastChangeDateTime

The above path will have all changes done to a contact person in the system.

If you need help creating a custom OData Service, please use the following documentation: https://help.sap.com/viewer/26fdb8fadd5b4becb5c858d92146d0e0/1708/en-US/8e4220fa6dc943ef891fb3d0e91515d3.html

Keywords

odata, notification, customized, Odata notification, contact, business partner , KBA , LOD-CRM-INT-API , OData API (C4C Only) , How To

Product

SAP Cloud for Customer all versions