You need to sign in to do that
Don't have an account?
Mihir Kumar 15
How to write test class that uses MessagingSession object
Hi,
I have written a trigger on ContentDocumentLinkobject to cover the below scenario:
1. If there is a ContentDocumentLink record created with a ContentDocumentId & Entity ID is of MessagingSession object, and
2. MessagingSession record referred in Entity ID has a case linked to it then
A new ContentDocumentLink record is created to link the ContentDocumentId and the case related to MessagingSession record referred in EntityID.
Now, I don't know how to write the test class of the same as I am not finding way to create MessagingSession record. Kindly help.
I have written a trigger on ContentDocumentLinkobject to cover the below scenario:
1. If there is a ContentDocumentLink record created with a ContentDocumentId & Entity ID is of MessagingSession object, and
2. MessagingSession record referred in Entity ID has a case linked to it then
A new ContentDocumentLink record is created to link the ContentDocumentId and the case related to MessagingSession record referred in EntityID.
Now, I don't know how to write the test class of the same as I am not finding way to create MessagingSession record. Kindly help.
Greetings!
Can you please check the below document for the metadata details of the MessagingSession Object which will help you in creating or linking the Objects while writing the test class:
https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_messagingsession.htm
Kindly let me know if it helps you and close your query by marking it as best answer so that it can help others in the future.
Warm Regards,
Shirisha Pathuri
Hi Mihir,
I have a same requirement.I have written a trigger on MessagingSession Object. I need to write test class for it where I need to create MessagingSession object records. Can you please share your code if you were able to resolve it.
Can you let us know how you wrote the test class for MessagingSession, what was your approach?
Regards,
Puneet.