javascript - Call C# Code from Ribbon JScript CRM Online 2011 -
i need have code execute on click of ribbon button on entity updates related data crm online 2011. prefer not have write of logic in jscript. there way call c# code jscript? have looked @ jscript file microsoft using ribbon , looks 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 remotecommand call being placed assume going web service function. hoping this. can add own web service functions?
i able make call jscript send "assign" message entity test. potentially work plugin-in, seems odd send message execution event did not occur run c# code ("assign", "update", etc.), , don't see way create own messages.
you can't add own web services or create own custom plugin messages in 2011. best way we've found of doing to:
- set entity exists exclusively run custom code on server.
- give attributes called message name , property pass in parameters in whatever format choose (xml, json, etc.)
- from javascript, create instance of entity passing in correct parameters.
- have plugin attached create message of entity, , reads in parameters , executes whatever custom code you'd like.
while randomly passing in assign message or might work, it's unsupported in microsoft's eyes, , hard hell debug if else ever had @ system.
Comments
Post a Comment