Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Change status reason based on opportunity phase

(0) ShareShare
ReportReport
Posted on by 595

Hi All,

Is it possible to change the status reason based on phase of the opportunity dynamically?

Thanks,

Abhilash.

*This post is locked for comments

  • Abhilash M abi Profile Picture
    Abhilash M abi 595 on at
    RE: Change status reason based on opportunity phase

    I have used the javascript

    var field = <Xrm.Page.OptionSetControl>Xrm.Page.getControl("statuscode");

           switch (stepName.getValue().charAt(0)) {

               case "1":

                   if (field != null) {

                       field.removeOption(596030006);

                       field.removeOption(596030007);

                       field.removeOption(596030008);

                       field.removeOption(596030009);

                       field.removeOption(596030010);

                   }

                   break;

               case "2":

                   if (field != null) {

                       field.removeOption(1);

                       field.removeOption(2);

                       field.removeOption(596030001);

                       field.removeOption(596030005);

                   }

                   break;

    But it is raising the error The object does not support the "removeOption" property or method

  • Suggested answer
    tw0sh3ds Profile Picture
    tw0sh3ds 5,600 on at
    RE: Change status reason based on opportunity phase

    Hi,

    If I understand you question you want to change opportunity status based on Business Process Flow Stage? It is possible using a plugin or a workflow (workflow can be triggered on Process Stage Change). If you meant another field on Opportunity - again it can be done using plugin, workflow or javascript.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,409 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans