Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Hiding Status Reason Values

(0) ShareShare
ReportReport
Posted on by 474

Hi,

Just wondering if its possible to 'hide' Status Reason field values instead of deleting them?

I have been given the task of clearing up a lot of our Status Reason values as some we never use anymore. But some we're not sure of and would like to keep but not display as an option.

Also, have just been testing this in our development site. What criteria is used when you delete a Status Reson value, i.e what does the Status Reason change to in the Opportunity when you remove its value comepletely? From what I can see from testing, it seems to change the Status Reason to the top reason in the list of values. Is there any way this can be configured?

Thanks as always

Ted

  • Suggested answer
    Anks27 Profile Picture
    1,083 on at
    RE: Hiding Status Reason Values

    If you want to remove the status reason then you need to map the old status reason to the new status reason before you delete the status reason.  If you don’t do it then when user will open up the record with the deleted status reason, it will try to look up the ‘Int’ value for the status reason and can’t find and then default status reason will be shown to the user.

    You can hide certain status reasons from being shown using javascript. You may use the following code on form load event.

    function RemoveOptions(formContext,controlName){

    var ctlOptionSet = formContext.getControl(controlName);

    var options = ctlOptionSet.getOptions();

    for (var i in options) {

    if (options[i].text.indexOf('zzz') == 0) // remove all options starting with zzz

      ctlOptionSet.removeOption(options[i].value);

    }

    }

    Don't forget to help the community by verifying the answer if your question has been answered. It will let others know that the topic has verified answer.

     

    Thanks & Regards,

    Ankit Shah

  • Suggested answer
    RajarajanS Profile Picture
    on at
    RE: Hiding Status Reason Values

    Hello Partner, 

    You can perform this action through Javascript code. The functions you will require are:

    Add Option: https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/controls/addoption

    Remove Option: https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/controls/removeoption

    clear options: https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/controls/clearoptions

    In your form that user is working with, you can retrieve the control of the particular option set field and you can use the above functions to show and remove options that we can see. This does not delete the values from the option set, it just dynamically displays values of your choice and criteria. You can try implementing these in your forms through the use of Javascripts. 

    Hope this helps.

    Best regards,

    Raj

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 78 Super User 2025 Season 1

#3
Sahra Profile Picture

Sahra 43

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans