Skip to main content
Post a question

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Hiding Status Reason Values

Like (0) ShareShare
ReportReport
Posted on 23 Nov 2020 13:28:32 by 460

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 24 Nov 2020 at 08:52:43
    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 23 Nov 2020 at 14:29:33
    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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,784 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,476 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Loading complete