web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

How to create auto post in timeline when a case is reactivated

(0) ShareShare
ReportReport
Posted on by 235

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

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    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.

    Snipaste_5F00_2022_2D00_02_2D00_02_5F00_17_2D00_47_2D00_28.png

    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. 

  • Jolas365 Profile Picture
    235 on at

    Hello ,

    Thank you very much for your response. Can you please also provide a sample JS code for this?

    Best regards,

    Jolas365

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Jolas365,

    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:

    Snipaste_5F00_2022_2D00_02_2D00_03_5F00_09_2D00_55_2D00_51.png

    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.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 51 Super User 2026 Season 1

#1
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 51 Most Valuable Professional

#3
Nagaraju_Matta Profile Picture

Nagaraju_Matta 50

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans