top of page

CRM 2015 – Javascript – Execution Context

This one can be quite interesting, the possibility of interacting with data from a plugin trough the Javascript, for now, i’m not seeing any example, but definitively is one to have a look, and what i think is quite interesting is regarding with  getSharedVariable and  setSharedVariable.

When you associate a function in a JavaScript library to an event handler in Microsoft Dynamics CRM, you can check the Pass execution context as first parameter option. The following table lists the execution context object methods.

Method Description

Returns the Xrm.Page.context object. See Client-side context (client-side reference) for more information.

Returns a value indicating the order in which this handler is executed.

Returns a reference to the object that the event occurred on.

Retrieves a variable set using setSharedVariable .

Sets the value of a variable that can be used by a hander after the current handler finishes.

Use the getEventSource method in functions to make them more generic. For example, if you have a function that formats a telephone number, you can use the getEventSource method to refer to whatever attribute caused the onChange event. Your functions do not need to reference a specific attribute.

Hope it gives you new ideas to extend even more CRM. 

1 view0 comments

Recent Posts

See All

CRM 365 - Customer field only show Accounts

On a customer field, if the requirement is to only show Accounts, please add this line to the OnLoad of the form: //Show only Account records when selecting the Customer formContext.getControl("cu

Execute Workflow Request on CRM 365 Cloud

Please find below an example of calling the Execute method to run a workflow on CRM 365 Cloud. let Id ='{', '').replace('}', ''); let request =


bottom of page