简体   繁体   中英

How to add ribbon button with custom serverside handler to Dynamics CRM web?

We need to import to some external system group of contacts that user selected in contacts grid.

For now the only option I see is: get IDs if selected contacts and send it to the to external system using JavaScript.

But is it possible on ribbon button press get list of selected contact on server side? We`d like to process this contacts on server and send them to external system using our C# code (in plugin, most likely)?

Yes, in a slightly longwinded way. You can't call server side code directly from JavaScript. You can however perform an action that will call server side code.

For example:

  • Create a new entity - 'Contact Processor', this has a lookup to a contact.
  • Place a plugin (or custom worfklow activity) on the create of a 'Contact Processor'. This uses the lookup to the contact to perform whatever logic you require, eg Sending the data to an external system.
  • You add some JavaScript to a ribbon button that when clicked creates 'Contact Processor' records, this will then trigger the server side code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM