Tuesday, January 28, 2014

Loading Dependent Web Resource Scripts for an Application Ribbon Button

(from Simon Kendall - learned CRM colleague an architect)

Let’s say I have  button on the homepage of an entity in CRM and it makes a REST service call. 

function onProgressWindowLoaded() {
    [code removed for clarity]
       XrmServiceToolkit.Rest.Retrieve(
            ticketIds[i],
            "apitil_incidentSet",
            null, null,
            function(result) {
               
            },
            function() { //can have error parameter i.e. error.message
                errorNotes += "Skipped: Ticket Id " + ticketReferences[i].Name + " error retrieving this ticket.";
            },
            false
        );

How do I load the web resource with the XrmServiceToolkit methods in it?  Multiple command actions using a dummy function name are your friend.  There are one million examples of this on the interweb.  It looks something like this in Ribbon Workbench:
Adding a button from the Ribbon Workbench


No comments:

Post a Comment