How To Pin An Email To The Case Timeline Using Power Automate?
So, I've figured out the first half, to pin an email I need to insert a record into msdyn_timelinepin. I have that working in xrmtoolbox sql4cds, now how do I do it in Power Automate?
insert into msdyn_timelinepin (msdyn_formrecordid, msdyn_pinnedrecordid, msdyn_pinnedrecordlogicalname, msdyn_timelinecontrolid, partitionid, ttlinseconds)
values('The GUID of the Case Record', 'The GUID of the Email Record', 'activitypointer', 'GUID of the Timeline Control', 'Concat of GUID of Case Record+GUID of Timeline Control', 31536000)
- the case and email GUIDs, you get those from the URL when in the records main form
- activitypointer is a constant for any activity record, since emails are closed activities, this makes sense
- timelinecontrolid not sure if this is specific per environment or not, but just pin an email, query the table and whatever GUID is there is the one you use.
- partitionid is the concat of the two GUIDs with a '+' between them, no space. Why this needs to exist, does not make sense, but populate it anyways. If you don't you will get an error when trying to query the table after the insert. You will need to delete the record before a select will work on the table.
- 31536000 is the number of seconds in 365 days. I'm guessing the system will automatically unpin the record after 1 year. I don't know if any other value will work and I'm not willing to take a chance, this is the value MS used so that's good enough for me.
Now to get a record inserted into msdyn_timelinepin using Power Automate, but how?
Thank you,
Jim