Skip to Content

ChangeHistory.Read for Contacts - unable to read email address changes

Hi All,

I'm trying to read the ChangeHistory for Contacts when the Email address(on header) is changed using the Standard BOs BusinessPartner and BusinessPartnerRelationship.
I've had a look at ChangeHistory.Read in C4C Cloud application Studio example and Event-BeforeSave ABSL - access to UUID but unable to read the the old and new values of the email address.

Code written in Before Save event of BusinessPartner.xbo is:

var UUID = this.GetFirst().UUID;
var change =
ChangeHistory.Read("AP.FO.BusinessPartner.Global:BusinessPartner" ,UUID ); 

Similar code in BeforeSave event of BusinessPartnerRelationship.xbo is:

var UUID = this.GetFirst().UUID;
var change =
ChangeHistory.Read("AP.FO.BusinessPartnerRelationship.Global:BusinessPartnerRelationship" , UUID); 

Is anyone able to guide me please?

Best Regards,
Preethi.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 21, 2017 at 11:15 AM

    Hello Preethi,

    With the association BusinessPartnerRelationship you are switching from the BO BusinessPartner to the BO BusinessPartnerRelationship. There is no further switch of BO in the rest of the associations.

    This means you need to access the BO BusinessPartnerRelationship, not the BusinessPartner.

    As your code above looks fine and the SAP coding includes also this BO, it should work.

    Please raise an incident on the component AP-RC-BDS-SCR.

    Sorry,
    . Horst

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 18, 2017 at 11:25 AM

    Hello Preethi,

    Did you verify if there are some values for the ChangeHistory like within the normal UI?

    Bye,
    . Horst

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Horst,

      I am looking for the Email element on the Header of a Contact. The Path is AP/FO/BusinessPartner/Global-Root-.CurrentDefaultIsContactPersonFor-.BusinessPartnerRelationship-.ContactPerson-.ContactPersonWorkplaceAddressInformation-.ContactPersonWorkplaceAddress-.DefaultEMail-~URI-~content . Hope this is what you're looking for.

      Thanks confirming about the BeforeSave event.

      Best Regards,
      Preethi Santhanam