Asif Faleel
asked on
Show/Hide Fields based on a Option field - Dynamics CRM
Hi I am trying to Show/Hide a Field based on the another field that is a two option field. Seems that when the Accounts form loads it correctly hides the field but when i select option "Yes" the hidden field does not reappear.
Sample code given below
function onCreditLimitChange()
{
var creditlimit = Xrm.Page.ui.controls.get(" dot_whethe rlimitbase dapproval" );
if ( creditlimit = false ) {
Xrm.Page.ui.controls.get(" dot_limita mount").se tVisible(t rue);
}
else {
Xrm.Page.ui.controls.get(" dot_limita mount").se tVisible(f alse);
}
}
Please help.
Sample code given below
function onCreditLimitChange()
{
var creditlimit = Xrm.Page.ui.controls.get("
if ( creditlimit = false ) {
Xrm.Page.ui.controls.get("
}
else {
Xrm.Page.ui.controls.get("
}
}
Please help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
Can you tell me if dot_limitamount is an OptionSet or Two Options?
If it is Two Options then you will not be able to make it null... It should be either True or False.
Can you tell me if dot_limitamount is an OptionSet or Two Options?
If it is Two Options then you will not be able to make it null... It should be either True or False.
ASKER
its a Currency field.
You can set it to 0.00 or 0 only.
ASKER
Whats the code i need to add for this to make it blank ?
Xrm.Page.getAttribute("dot _limitamou nt").setVa lue(null);
or
Xrm.Page.getAttribute("dot _limitamou nt").setVa lue(0);
or
Xrm.Page.getAttribute("dot
ASKER
Done.
Hi,
Is there any reason to mark the answer and accepting the solution as B? Is there anything missing in my answer?
In my knowledge I have provided perfect answer and I am eligible for all points.
Is there any reason to mark the answer and accepting the solution as B? Is there anything missing in my answer?
In my knowledge I have provided perfect answer and I am eligible for all points.
ASKER
Ohhh sorry i did not mean to do that. Is there anyway i can correct this?
You can Click on Request Attention button and raise a request to moderator. He will handle the things.
ASKER
One more help. How do i make the dot_limitamount blank or null when the option is set to false.