Global Javascript function for MS CRM Entities

Normally it is not possible to write Global/Common Javascript methods for CRM entities, becuase it allowing to write inside the event scripts.

To obtain this write the javascript function inside the entity event handler and assign to a global variable. Then the variable will be act as function.

To declare a variable as global just declare without "var" in statements.

Eg:

CommonConvertPreferredCurrency = ConvertPreferredCurrency;

function ConvertCurrencySymbol(currencySymbol){
// to do
}

The global functions can be called in same form anywhere in same form. However it will not work as .js files

0 comments:

Post a Comment