Notifications
Announcements
No record found.
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
duplicate : https://community.dynamics.com/crm/f/117/t/320048
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);
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
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.
Is integer field also a option set?
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
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()
{
if( integerValue == 1 || integerValue == 2 || integerValue == 3)
}
else{
Xrm.Page.getAttribute("Name of optionset field").setValue(2); // set some default value
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
SA-08121319-0 4
Calum MacFarlane 4
Alex Fun Wei Jie 2