Gane
Gane

Reputation: 120

Call Web resource (Html/JS) from CRM plugin?

I want when some code in plugin execute, then call or trigger on some way a web resource, so is it even possible and how I can call it?

NOTE: its important that first execute a plugin and then web resource!

Upvotes: 0

Views: 1079

Answers (1)

James Wood
James Wood

Reputation: 17552

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.

Upvotes: 1

Related Questions