Hi,
I have requirement, if stage change from suspect to Prospect or Forecast, based on user id system will give below warning message and the previous value (suspect) should store in stage.
but here system give message and cursor will be on Prospect or forecast. When click on ok button again give message . It repeating and in loop. After 6 or 7 times click on the cursor will go to Suspect.
I noticed when set any value on dropdown list options, the dropdown list will expand as shown below and we need select by mouse to set that option.
This could be the reason for repeating message in loop. Please help me to set value in dropdown list by using java script.
optrtcode = Xrm.Page.getAttribute("opportunityratingcode").getValue(); - to store current value
if(Xrm.Page.getAttribute("opportunityratingcode").getValue() == '200000' ||Xrm.Page.getAttribute("opportunityratingcode").getValue() == '3')
{
alert(" Please contact sales manager to change stage to prospect or forecast");
Xrm.Page.getAttribute("opportunityratingcode").SetValue(optrtcode); - to store previous value after giving message
Xrm.Page.getControl("opportunityratingcode").setFocus(true);
}