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);
}
*This post is locked for comments
Hi Gopalan,
Thanks for your help. It is working now.
Regards,
Hi
As you are updating the same field, try introducing timeout and check.
community.dynamics.com/.../simple-javascript-form-notification-with-timeout
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,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156