Announcements
Hello CRM Experts,
Do you know of a way to create an auto post in the timeline when a case has been reactivated. The post should contain the name of the user who reactivated the case?
Thanks,
Jolas365
Hi Jolas365,
You could achieve this by using Ribbon Workbench. Steps:
1. Create a JS type web resource in which you need to get current user name, case GUID and create post which is regarding to the current case record. Finally, add the OOB function which in the Function Name of Reactivated Case button's command.
2. Customize the Reactivated Case button's command. Replace it with the web resource created in step 1.
3. Publish your solution is ok.
BTW, if you are stuck in the JS code to create post, I could provide a sample for you.
Hello ,
Thank you very much for your response. Can you please also provide a sample JS code for this?
Best regards,
Sample:
function reactivatedCase(formContext) { var caseId = formContext.data.entity.getId().replace(/({|})/gm, ""); var UserName = formContext.context.getUserName(); var data = { "text": "Case reactivated by " + UserName , "regardingobjectid_incident@odata.bind": "/incidents("+ caseId + ")", "type": 7, "source": 2 }
var req = new XMLHttpRequest(); req.open("POST", Xrm.Page.context.getClientUrl() + "/api/data/v9.2/posts",true); req.setRequestHeader("OData-MaxVersion", "4.0"); req.setRequestHeader("OData-Version", "4.0"); req.setRequestHeader("Accept", "application/json"); req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function () { if (req.readyState === 4) { JSON.parse(req.responseText); } } req.send(JSON.stringify(data)); CrmService.IncidentRibbon.CommandBarActions.reactivate();}
Command setting:
If you want to change the value in the fields of post entity, please refer to it:
post EntityType (Microsoft.Dynamics.CRM) | Microsoft Docs
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Jump in, show your community spirit, and win prizes!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Abhilash Warrier 51 Super User 2026 Season 1
Muhammad Shahzad Sh... 51 Most Valuable Professional
Nagaraju_Matta 50