Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Sales forum / Hiding Status Reason V...
Sales forum
Suggested answer

Hiding Status Reason Values

Posted on by 433

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
    Anks27 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
    RajarajanS 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.

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

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

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,252 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,089 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans