I have created a integer entity and optionset entity,I have to autopopulate the optionset field value when the interger field value is given using javascript
*This post is locked for comments
I have created a integer entity and optionset entity,I have to autopopulate the optionset field value when the interger field value is given using javascript
*This post is locked for comments
May I know what is the business scenario ,?user can put any value in integer field which may not match the value of optionset.
Assuming that user would be fill predefined value to integer field in that case you can create business rules as well.But keep in mind business rule will not set any value to the optionset if integer value does not match.
You can go with JS ,like below, register function form onload and integer field on Change event.
function onChangeIntVal()
{
var integerValue=Xrm.Page.getAttribute("Name of Integer field").getValue();
if( integerValue == 1 || integerValue == 2 || integerValue == 3)
{
Xrm.Page.getAttribute("Name of optionset field").setValue(integerValue);
}
else{
Xrm.Page.getAttribute("Name of optionset field").setValue(2); // set some default value
}
}
No integer field is not option set ,but when the value given by the user in the int field the option set field must autopopulate to the appropriate value from the provided value in the option set
Is integer field also a option set?
Tq for your response but my question is if i select any value in the integer field,the option set field value also want to get autopopulated.
I have created a integer entity and optionset entity,I have to autopopulate the optionset field value when the interger field value is selected using javascript
You have to write script on load and on save event.
You can use below code:
var integerValue=Xrm.Page.getAttribute("Name of Integer field").getValue();
Xrm.Page.getAttribute("Name of optionset field").setValue(integerValue);
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,280 Super User 2024 Season 2
Martin Dráb 230,214 Most Valuable Professional
nmaenpaa 101,156