web
You’re offline. This is a read only version of the page.
close
Skip to main content
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 479

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

I have the same question (0)
  • Suggested answer
    Anks27 Profile Picture
    1,085 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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Hamza H Profile Picture

Hamza H 141

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 132

#3
DAnny3211 Profile Picture

DAnny3211 130

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans