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

Announcements

No record found.

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 180 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 123

#3
CU11031447-0 Profile Picture

CU11031447-0 100

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans