Tuesday, 9 June 2015

Passing parameters to JavaScript Web Resource function in CRM


Today when I was talking to one of my friends who is not a CRM developer asked me a question.

How to pass parameters to the Webresource function in CRM?

Here is the way for it.

I have a written a JS method which takes the parameter and display them as an alert.

function OnLoad(executionContext, strFirstParameter, strSecondParameter) {
    var vParameters = "First Parameter :" + strFirstParameter + "\n" + "Second Parameter :" + strSecondParameter;

If you select check box 'Pass execution context as first parameter', automatically you will ExecutionContext as a parameter.

Along with ExecutionContext, I have added two parameters.

Here is the result when I opened an Account record.

Hope this helps.

Happy CRM'ing


  1. Nice post...I look forward to reading more, and getting a more active part in the talks here, whilst picking up some knowledge as well..

    Pass Box manufacturers