从CRM插件调用Web资源(Html / JS)?

时间:2015-06-26 07:48:08

标签: html plugins dynamics-crm crm

我希望当插件中的某些代码执行,然后以某种方式调用或触发Web资源时,它是否可能以及如何调用它?

注意:首先执行插件然后再执行Web资源非常重要!

1 个答案:

答案 0 :(得分:1)

A plugin cannot directly communicate with form script. However communication can be achieved through the data model. Based on your comments, I would suggest the following approach.

  1. Create a plugin to create and store the document against the case record. (Perhaps set a flag field on the case to indicate the document is available).

  2. In your web resource have JavaScript which queries CRM using OData to see if the document is available (perhaps based on the flag field). Then provide the document for download. You may also need to make some consideration around when to offer the download, as form script will run every time the form is loaded, constantly offering the document for download could be annoying for the user.

Alternatively, just do step 1. Then the user can download the document manually like every other attachment. If you have a flag field its easy to show a message that the document is ready.