Hello,
I'm unable to find show field values component in business rule on MS Dynamics 365 version which is available on MS Dynamics 2016 version
Thank You
T. Indra Kumar
*This post is locked for comments
Hello,
I'm unable to find show field values component in business rule on MS Dynamics 365 version which is available on MS Dynamics 2016 version
Thank You
T. Indra Kumar
*This post is locked for comments
Alternatively you could also use linked lookups, where a value in the first lookup filters the second lookup. If you have to use picklists rather than lookups then you will need to use JavaScript (in addition to the code snippets others have provided there is also an example in the SDK)
In addition to Francesco's response, you can also do the following:
Add an OnChange event to the control that you want to add within the form User Interface:
In the Form, click on the Control, select Change Properties on the Ribbon, click on the events tab and enter the name of the JavaScript Library and Function that you want to add the logic to.
If you are using Dynamics 365 v8.2 or v9, you should start using the new client api, and pass the execution context as a parameter to your function:
// Old Client API
function picklistOnChange()
{
var fieldValue = Xrm.Page.getAttribute("new_picklistname").getValue();
switch (fieldValue)
{
case 10:
// Perform some action
break;
case 20:
// Perform other action
break;
default:
// Perform default action
break;
}
}
// New Client API
function picklistOnChange(context)
{
var entityObject = context.getFormContext().data.entity;
var fieldValue = entityObject.attributes.getByName("new_picklistname").getValue();
// Add Same Switch Statement as in Old Client API function
}
If you need to change values of options sets you can use the following control methods:
Xrm.Page.getControl("controlName").addOption( {value: 1, text: "Active" });
Xrm.Page.getControl("controlName").removeOption(10);
Xrm.Page.getControl("controlName").clearOptions();
Take a look at the following articles for more info:
neilparkhurst.com/.../javascript-control-optionset-values
Hope this helps.
Hi Indra,
a such functionality has never been released in Business action (hiding an option).
You could reach your goal with javascript:
function OnLoad() { Xrm.Page.getAttribute('new_myattribute').addOnChange(MyAttributeOnChange); } function MyAttributeOnChange() { var new_myattribute = Xrm.Page.getAttribute("new_myattribute").getValue(); if (new_myattribute == VALUE_TO_CHECK) Xrm.Page.getControl('customertypecode').removeOption(3); // value of option }
Please let me know if you solve
If you found the answer helpful, please mark as Verified
Join my network on LinkedIn Follow me on Twitter
Thank You & Best Regards
Francesco Picchi
Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY
Independent Contractor
Thank you Iswarya for your valuable suggestion. But my question is not exactly what you answered. My question is, I want to set field values (like when is select one value in option set filed i should be able to set visible options in that option set). Using set Visibility we can set the entire field show/hide but not the options in optionset field
Hi,
you can use SetVisibility instead of ShowField
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156