Monday, April 11, 2011

Make Business required level only ms crm 2011

Its bit different than ms crm 4.0.
beawre of only the following while doing so.
Reducing the required level of an attribute can cause an error when the page is saved. If the attribute is required by the server an error will occur if there is no value for the attribute.
just use the setRequiredLevel("<requirementLevel>") function.

var objAttribute = Xrm.Page.data.entity.attributes.get("<attributeName>");
objAttribute.setRequiredLevel("<requirementLevel>").

also in other hand
(Xrm.Page.data.entity.attributes.get("<attributeName>")).setRequiredLevel("<requirementLevel>").
but the trick is you need to put that backet else it will not work
Xrm.Page.data.entity.attributes.get("<attributeName>").setRequiredLevel("<requirementLevel>").
so the following will not work... :(

#parameter can be
none -> not Required
required -> Business Required
recommended -> Business Recomended

Sudhanshu

No comments:

Post a Comment