Skip to Content
0

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

Jul 18, 2017 at 08:58 AM

78

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Horst Schaude
Jul 21, 2017 at 11:15 AM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hello Horst,

Many thanks for your time in looking into this. I shall raise an incident as suggested.

Best Regards,
Preethi.

0
Horst Schaude
Jul 18, 2017 at 11:25 AM
0

Hello Preethi,

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

Bye,
. Horst

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Hi Horst,

Thanks for your reply. Yes, all changes are recorded in the Changes tab.

Best Regards,
Preethi.

0

Hi Horst,

Maybe some details on the requirements may help - If the Name/Email address/ Account linked with this Contact changes, we need to send some details to an external system via a web service.Also, is BeforeSave the best event to capture values from ChangeHistory? I see changes made as part of Change1 is retried in the BeforeSave event when I make Change2.

Best Regards,
Preethi.

0

Hello Preethi,

Can you tell me the exact element you are looking for? including the path from the Root node?

Reg. "BeforeSave" it is the latest available event you can get.

Bye,
. Horst

0

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

0