Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

dynamics 365 ribbon toolbar call for action [RIBBON WORKBENCH]

(0) ShareShare
ReportReport
Posted on by 385

Hi,

So I'm using ink ribbon workbench in order to customize my ribbon I was able to create a button to call for a workflow now I'm looking for some guidance how can I create a button to call for Action that I created. 

So if someone can help me to explain how can I create button to call for Action I will appreciate it.

Thanks in advance

*This post is locked for comments

  • Suggested answer
    Justinjose Profile Picture
    Justinjose 2,707 on at
    RE: dynamics 365 ribbon toolbar call for action [RIBBON WORKBENCH]

    Hi alexyou,

    Bit confused about your question. If you want to call Action (javascrit)  in the Ribbon Workbench, please follow below link

    crm.fueledbysleep.com/.../getting-started-with-actions

    community.dynamics.com/.../creating-a-ribbon-button-using-ribbon-workbench-to-call-a-javascript-action

    www.cobalt.net/.../ribbon-workbench-solution

    If you want to call Workflow using Action by Javasctipt then please have a look below link.

    dynamicscrmcoe.com/calling-custom-action-using-javascript

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/customize/invoke-custom-actions-workflow-dialog

    https://github.com/jlattimer/CRMRESTBuilder

    Thanks

    Justin Jose

  • Suggested answer
    Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,205 on at
    RE: dynamics 365 ribbon toolbar call for action [RIBBON WORKBENCH]

    Hi Alex,

    Step1 : Add a javascript web resource like below.

    function CallActionFromJavaScript() {

       var accountId = Xrm.Page.data.entity.getId(); // record ID

       var entityName = "account"; // Entity Name

       var requestName = "Plugin_process"; // Action Name

       ExecuteAction(accountId, entityName, requestName);

    }

    function ExecuteAction(entityId, entityName, requestName) {

       // Creating the request XML for calling the Action

       var requestXML = ""

       requestXML += "<s:Envelope xmlns:s=\"schemas.xmlsoap.org/.../envelope\">";

       requestXML += "  <s:Body>";

       requestXML += "    <Execute xmlns=\"schemas.microsoft.com/.../Services\" xmlns:i=\"www.w3.org/.../XMLSchema-instance\">";

       requestXML += "      <request xmlns:a=\"schemas.microsoft.com/.../Contracts\">";

       requestXML += "        <a:Parameters xmlns:b=\"schemas.datacontract.org/.../System.Collections.Generic\">";

       requestXML += "          <a:KeyValuePairOfstringanyType>";

       requestXML += "            <b:key>Target</b:key>";

       requestXML += "            <b:value i:type=\"a:EntityReference\">";

       requestXML += "              <a:Id>" + entityId + "</a:Id>";

       requestXML += "              <a:LogicalName>" + entityName + "</a:LogicalName>";

       requestXML += "              <a:Name i:nil=\"true\" />";

       requestXML += "            </b:value>";

       requestXML += "          </a:KeyValuePairOfstringanyType>";

       requestXML += "        </a:Parameters>";

       requestXML += "        <a:RequestId i:nil=\"true\" />";

       requestXML += "        <a:RequestName>" + requestName + "</a:RequestName>";

       requestXML += "      </request>";

       requestXML += "    </Execute>";

       requestXML += "  </s:Body>";

       requestXML += "</s:Envelope>";

       var req = new XMLHttpRequest();

       req.open("POST", Xrm.Page.context.getClientUrl() + "/XRMServices/2011/Organization.svc/web", false);

       req.setRequestHeader("Accept", "application/xml, text/xml, */*");

       req.setRequestHeader("Content-Type", "text/xml; charset=utf-8");

       req.setRequestHeader("SOAPAction", "schemas.microsoft.com/.../Execute&quot;);

       req.send(requestXML);

       //Get the Resonse from the CRM Execute method

       var response = req.responseXML;

       alert("Saved successfully");

    }

    Step 2: Add a custom button and call the above function from that custom button, below is the link for adding button ,

    mahenderpal.wordpress.com/.../calling-java-script-on-click-of-command-button-ms-crm-2015-step-by-step

    If you find it helpful, please mark my answer as Verified.

    Best Regards,

    Shahbaaz

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans