Passing parameters to JavaScript Web Resource function in CRM

Hi,

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;
    alert(vParameters);
}

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
Gopinath.

2 thoughts on “Passing parameters to JavaScript Web Resource function in CRM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s