Wednesday, April 11, 2012

MS CRM 2011 Javascript Syntax

Xrm.Page
Xrm.Page is the JavaScript namespace where you can access CRM form UI Elements and fields.

Returns an attribute on the form:
Xrm.Page.getAttribute("field");

Returns a control on the form:
Xrm.Page.getControl("field");

Xrm.Page.ui
This namespace contains functions for manipulation of the form UI. This includes tabs, sections and fields.

Returns type of form like update, create, etc.:
Xrm.Page.ui.getFormType();

Returns width of view in pixels:
Xrm.Page.ui.getViewPortWidth();

Returns current active control:
Xrm.Page.ui.getCurrentControl();

Returns a control on the form:
Xrm.Page.ui.controls.get("field");

Returns the property of the tab:
Xrm.Page.ui.tabs.get("tabName");

Xrm.Page.context
The context object provides methods to retrieve information specific to an organization, a user, or parameters that were passed to the form in a query string.

Return the GUID of the current user:
Xrm.Page.context.getUserId();

Returns the current user role/roles.:
Xrm.Page.context.getUserRoles();

Returns whether a user is in the Outlook client.:
Xrm.Page.context.isOutlookClient();

To check the outlook client is online:
Xrm.Page.context.isOutlookOnline();

Returns the unique org name for the current active organization:
Xrm.Page.context.getOrgUniqueName();

Returns the url of the server.:
Xrm.Page.context.getServerUrl();

Returns the authentication header required to make SOAP calls.:
Xrm.Page.context.getAuthenticationHeader();

Returns the current Outlook theme chosen by the user
Xrm.Page.context.getCurrentTheme();

Returns the LCID value for the base language of the
Organization
Xrm.Page.context.getOrgLcid();

Returns an array of key value pairs representing the query
string arguments that were passed to the page
Xrm.Page.context.getQueryStringParameters();

Returns the LCID value that the user selected as their
preferred language
Xrm.Page.context.getUserLcid();

Prepends the organization name to the specified path
Xrm.Page.context.prependOrgName();

Xrm.Page.data.entity
Provides methods to retrieve information specific to the record displayed on the page, the save method and a collection of all the attributes included in the form

Returns the current entitys GUID:
Xrm.Page.data.entity.getId();

Returns the current entities schema/logical name.:
Xrm.Page.data.entity.getEntityName();

Forces a manual save of the entity:
Xrm.Page.data.entity.save();
http://www.blogger.com/img/blank.gif
Determines whether or not the form is dirty,
i.e. if there are any unsaved changes.:
Xrm.Page.data.entity.getIsDirty();

Returns the property of the tab:
Xrm.Page.ui.tabs.get("tabName");

For more and other information please browse the link

3 comments:

Anthony said...

Excellent interview questions man. This couldn't be any better, Cheers

Ridhi Arora said...

Your posts is really helpful for me.Thanks for your wonderful post. I am very happy to read your post. It is really very helpful for us and I have gathered some important information from this blog.

thanks for sharing

Breast Cancer
Popular Massage Techniques
Should Listen To
Cosmetic Surgery
Hair Loss Treatment for Men
9 Incredible Foods That Fight Cancer
How To Boost Up Your Small Business

Ridhi Arora said...

Great post! I am actually getting ready to across this information, It's very helpful for this blog.Also great with all of the valuable information you have Keep up the good work you are doing well.
Engagement Ring
Gifts For Home Decoration
Gift Ideas
Great Gift
Video Broadcasting In Office 365

Split the String values with a special character in MS Flow to convert this into Array

 Many times we have a requirement to prepare the Mailing address for some of the documents, suppose there are Address Line1, Address Line2, ...