web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer Service forum

Javascript errror

(0) ShareShare
ReportReport
Posted on by 1,942

Hi All,

I have the follow JS code which is enabled for a custom entity. When field value = 100000000 it will not execute the step inside it and it automatically goes to else condition.

Did I miss anything here?

function SetMultiSelValues(executionContext){
debugger;
var formContext = executionContext.getFormContext();
var selectedValues = formContext.getAttribute("new_flagreason").getSelectedOption(); //Multi-option set field
if(selectedValues == null){
formContext.getAttribute("iis_flagstatusnew").setValue("0"); //No issues
}
else{
if(selectedValues == 100000000 ){
formContext.getAttribute("iis_flagstatusnew").setValue("0"); //No issues
}
else{
formContext.getAttribute("iis_flagstatusnew").setValue("1"); //Issues Exists
}
}
}

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    33,628 on at

    Hi,

    you need to add one more code to your getSelectedOption

    Xrm.Page.getAttribute("fieldname").getSelectedOption().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.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Customer Service

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans