edmarco09 | 2021-04-23 07:21:49 UTC | #1
Hi. I am following the example on this link. https://help.mypurecloud.com/articles/use-the-extension-points-to-customize-saving-interaction-logs/
What I need is the sample payload pass on this method: public String onSaveLog(String data)
I tried displaying it on debug logs but it seems it is not allowed to display the whole content. I like to know what are the available methods and attributes that I could use. Is there any available documentation on this?
Thanks. :slight_smile:
Jerome.Saint-Marc | 2021-04-26 08:41:58 UTC | #2
Hello,
I unfortunately don't have a sample to share, not having access to a Salesforce environment. But I hope the following can help you already.
The data string is a JSON serialized object. You can deserialize it back and access the different attributes, as it is shown in the Example which appears at the bottom of the page you referenced in your question.
The object will contains 3 attributes ("top level"):
- eventName - a string
- interaction - an object
You can find information about the interaction object and its attributes here. Some of the interaction attributes are specific to a media type (email, call/phone, ...) - so they should only be present/populated if the conversation is of that media.
I unfortunately don't have a sample of this specific object, but these 2 pages - on processCallLog and on openCallLog mention *possible interaction log data: subject, notes, selectedContact, selectedRelation*. You would likely have to test the presence of these attributes in your code, before trying to access them. I mean checking if these attributes are present (I don't know if the attribute is present if subject or notes or ... were not specified or changed).
Regarding the truncated display in your debug logs, you may check this Salesforce forum page: https://salesforce.stackexchange.com/questions/116502/console-log-truncates-my-debug Apparently System.debug does not allow untruncated debug anymore (according to the comments). But you could try inserting line breaks (as mentioned in the comments) Or in the case of the onSaveLog data string, print eventName, interaction and callLog separately (deserializing the data string, and serializing eventName, interaction and callLog separately).
Hope this helps.
Regards,
system | 2021-05-27 08:42:02 UTC | #3
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 10718