I need some code to be executed when the ribbon button is clicked on an entity that updates some related data from CRM Online 2011. I would prefer not to write all this logic in JScript. Is there a way to call C # code from JScript? I looked at the JScript file that Microsoft uses from the tape and looks like this:
Mscrm.Campaign.copyCampaign = function (campaignId, saveAsTemplate) { var $v_0 = new RemoteCommand("MarketingAutomation", "CopyCampaign", null); $v_0.SetParameter("campaignId", campaignId); $v_0.SetParameter("saveAsTemplate", saveAsTemplate.toString()); var $v_1 = $v_0.Execute(), $v_2 = $v_1.ReturnValue; openObj(Mscrm.EntityTypeCode.Campaign, $v_2, null, null, Mscrm.NavigationMode.NavigationModeInline, null); Mscrm.Utilities.refreshParentGrid(Mscrm.EntityTypeCode.Campaign, campaignId) };
I see that the RemoteCommand call is being removed, which I believe is returning to some web service function. I hope to do something like this. Can I add my own web service features?
I managed to call from JScript to send an “Assign” message to an object in the same way as a test. This could potentially work with the plugin, but it seems strange to send a message for a run event that actually didn’t just happen to run some C # codes ("Assign", "Update", etc.), and I don’t know t see a way to create your own messages.
javascript c # dynamics-crm dynamics-crm-2011 dynamics-crm-online
Chad
source share