web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

on change of priority field in case entity

(0) ShareShare
ReportReport
Posted on by

Hi,

In the case entity having the priority field, which is an option set, having options Low, Medium, High.

While updating the priority field, I need to restrict the user to degrade the values.

i.e, If a case record is created with priority as "Medium", then while updating this record, this field value should not be "Low", but it can be change to "High".

How we can achieve this functionality.

I have the same question (0)
  • Verified answer
    Guido Preite Profile Picture
    54,086 Moderator on at

    this functionality can be done with javascript but I suggest to do a server-side check, using a synchronous classic workflow.

    Probably with the classic workflow you can do it with just a couple of IF conditions (if you have only 3 values) otherwise also with a plugin (by writing c# code).

    This to just give an overview, depends on the check you want to go forward me or other users can provide some links on how to implement it

  • Suggested answer
    XM-22040801-0 Profile Picture
    11 on at

    Hello,

    Via javascript code, you can remove the choices you want from the priority field.
    To remove an option, use removeOption(). See https://learn.microsoft.com/en-us/power-apps/developer/model-driven-apps/clientapi/reference/controls/removeoption

    For your needs, this would look like:

    function onFormLoad(execCtx) {
        const formCtx = execCtx.getFormContext();
        const priorityAttr = formCtx.getAttribute("prioritycode");
        const priorityValue = priorityAttr.getValue();
    
        if (priorityValue != null) {
            // Remove options
            const options = priorityAttr.getOptions();
            const lowerPriorityOptions = options.filter(o => o.value > priorityValue);
    
            const priorityCtrl = formCtx.getControl>("prioritycode");
            lowerPriorityOptions.forEach(o => priorityCtrl.removeOption(o.value));
        }
    }

    Register this function on form load.

    Examples:

    For a Low priority:

    pastedimage1681306899977v1.png

    For a Normal priority:

    pastedimage1681306940100v2.png

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 96 Super User 2025 Season 2

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans