Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

Instead of Error Message when chosing a field value, showing a Warning / Note without locking the field ??

(0) ShareShare
ReportReport
Posted on by 17

Hi experts, 

I am trying to show a warning message when a user is chosing a specific value in an option set. The Error Message created through a business rule would actually be perfect - BUT users should still be able to chose this value. With the error message, the value is locked and cannot be used. 

Is there a way to unlock the field and still have the error message appearing? 

Or is there maybe a different way of kind of showing a warning message? 

I know about the "recommendation" function, but it doesn't suit our needs since the user must click on the symbol to see the message. We need something that kind of pops up and draws attention... 

Thank you so much for any ideas!! 

  • Suggested answer
    Abdul Wahab Profile Picture
    12,085 Moderator on at
    RE: Instead of Error Message when chosing a field value, showing a Warning / Note without locking the field ??

    Hi yvka123,

    I do not this there is any other way. 

    If I answer your question then please mark it as verified.

    Let me know if I can provide you with more details.

    Thanks
    Regards,

    Abdul Wahab
    Power Platform & Customer Engagement Developer/Lead/Solution Architecture/Project Manager
    Direct/WhatsApp:+923323281237
    E-mail: abdulwahabubit@outlook.com
    Skype: abdul.wahabubit
    Linkedin: www.linkedin.com/.../

  • yvka123 Profile Picture
    17 on at
    RE: Instead of Error Message when chosing a field value, showing a Warning / Note without locking the field ??

    Hi Abdul,

    thank you so much for your reply! Is there any way to do this in Low Code?

    I'm not a programmer unfortunately.

    Thanks

  • Suggested answer
    Abdul Wahab Profile Picture
    12,085 Moderator on at
    RE: Instead of Error Message when chosing a field value, showing a Warning / Note without locking the field ??

    Hi yvka123,

    You need to write something similar to below:

    function myfunction() {
        try {
            let formContext = _primaryControl;
            let optionSetValue = this.getValue(formContext, "maa_paymentgateway");
            if (optionSetValue === 809790000)
                openAlertDialog("This is alert");
                
        } catch (e) {
            openAlertDialog("Error"   e.message   ".");
        }
    }

    function getValue(_formContext, _attribute) {//If control is missing than return ""
        let value = "";
        try {
            if (this.getControl(_formContext, _attribute) === true)
                value = _formContext.getAttribute(_attribute).getValue();
        } catch (e) {
            this.openAlertDialog("Error in getValue: "   e.message   ".");
        }
        return value;
    }

    function getControl(_formContext, _control) {
        let control = false;
        try {
            if (_formContext.getControl(_control))
                control = true;
        } catch (e) {
            openAlertDialog("Error in getControl: "   e.message   ".");
        }
        return control;
    }

    function openAlertDialog(_text) {
        try {
            Xrm.Navigation.openAlertDialog(_text);
        } catch (e) {
            Xrm.Navigation.openAlertDialog("Error in openAlertDialog: "   e.message   ".");
        }
    }

    If I answer your question then please mark it as verified.

    Let me know if I can provide you with more details.

    Thanks
    Regards,

    Abdul Wahab
    Power Platform & Customer Engagement Developer/Lead/Solution Architecture/Project Manager
    Direct/WhatsApp: 923323281237
    E-mail: abdulwahabubit@outlook.com
    Skype: abdul.wahabubit
    Linkedin: www.linkedin.com/.../

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,013 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans