[tweetmeme source=”BenHosk” only_single=false]
I could hide sections and tabs ok, using the Page ui but setting variables was really starting to bug me. I could get it too work using crmForm but I wanted to move on and use the new code.
The UI bit makes sense but looking at this I couldn’t see how to get the actual fields!!!
once you get the variable you can then getValue or setValue
Xrm.Page.getAttribute(“hosk_display2″).setValue(“HOSK SET THIS CRM 2011 STYLE”);
Get the value from a field
Set the value on a field
Xrm.Page.getAttribute(“hosk_field”).setValue(“new value”) ;
Setting requirement level for a field
There are three requirement levels “none”, “required”, “recommended”. Required means it must be filled in (red asterisk), recommended is the blue cross and none is obvious. It’s useful to be able to change the requirement settings dynamically because you can then make users fill in fields after they changed another field or make fields not required.
hide = setVisable(false)
show = setVisable(true)
You can hide and show a section as well
Call the onchange event of a field
Get the selected value of picklist
Set the focus to a field
Stop an on save event
event.returnValue = false;
Return array of strings of users security role GUIDs:
god bless the boys from Power Objects