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,...
Suggested Answer

Looking to pop up a message

(0) ShareShare
ReportReport
Posted on by 208

OK Here we go now:

I'd like to pop up a message box for any number of conditions on the contact record.  The biggest one that I can think of is Custom Gender Identity.  Every time the card for a contact is opened up a webpage dialog reminding the person of the customer's preferred pronouns comes up.  The other thing I was think of is so-called security alerts.

[What I've done for gender identity warnings]

* Created 2 custom attributes "Gender As Identified" and "Gender as Identified (custom value)" when the contact is created there's a script that needs reading and then they pick from a picklist with options (Male (he/him/his), Female (she/her/hers), Non-Binary (they/them/theirs), Decline to State, Some other value (see blank below)) and if the custom value is chosen, then obviously I'd want the rep to fill it in just like those options in the picklist as a template.

* it's now up to the individual who now gets the next call to go to the contact's detail tab and look for the gender identity preferences which again can be a human error to ignore it or forget or the like.

[Security Warnings]

* on both the account and the contacts records, the first tab is a custom tab with a large edit box called "Alerts & Warnings" with a large edit box that is just supposed to be reviewed and it's on the honor system that you won't change it unless you have to so important things don't get "berried in the notes"... but anyone can edit this if they desire to delete them, change them etc.  We use this alerts and warnings tab for all kind of things mainly things like "*** PER ESD JENNETTE M.: on 01/01/23: Safety Alert***: Customer Known to be Abusive, Disconnect or Transfer to Super" or disability warnings like "*** DISABILITY ALERT***: Customer is nonverbal and uses an iPad to communicate.  Please wait for typed response as response times may be slower.  Do not disconnect until told to do so by customer. ****" or other such things.

Since this is a free-form edit, anyone can add to it, remove from it, or change it at will which is not good for data integrity. 

Are there workflows and/or javascript that I can attach to the OnLoad event to the people on the phones or in chat can see these critical things?  are there JS and/or workflow that can be used to lock it down so these critical values cannot be edited "just for the fun of it"?

I know there's something by c360 called "Alerts" but they are not selling a version for 4.0 so I need to use the tools I have.

Anyhow, any help in this matter would  be helpful.

I have the same question (0)
  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at

    Hi,

    For Free-Text Field you can use field level security as described in below link:
    https://www.encorebusiness.com/blog/field-level-security-in-microsoft-dynamics-365-crm/

    In Field level security you can define Teams or User with set of privilege such as Read, Update and Create.

    Other way is we can write JavaScript which will helps to lock field based on condition as described below:

    https://www.crmcrate.com/javascript/lock-unlock-fields-using-javascript-in-dynamics-crm/

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at

    If u dont want to provide permission to edit those fields then make it read only on the form... So that no one will edit it. 

    If u want to make sure only selective users with specific roles can edit it then just.... Check the user roles on the load of the form and if it meets the condition then make it editable.

    Thank you, 

    Amit Katariya

  • CGFleischmann Profile Picture
    208 on at

    Can you provide example of the code to check role on load?

  • Suggested answer
    Pradeep Rai Profile Picture
    5,489 Moderator on at
  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at

    www.c-sharpcorner.com/.../

  • CGFleischmann Profile Picture
    208 on at

    I'll definitely look at it.  But before I try to implement; that looks like it's for a newer version of CRM.  Will that still work in CRM 4.0?

  • Suggested answer
    Amit Katariya007 Profile Picture
    10,409 Super User 2025 Season 2 on at

    Check out that specific versions developers guide. 

  • CGFleischmann Profile Picture
    208 on at

    See the CHM of the Developer documentation and it's not very well organized (I search for "banner" or "popup" or similar term and it get nowhere) but that is usually my first reference.  Thanks for the thought

  • CGFleischmann Profile Picture
    208 on at

    so here's some updates:

    1.  I figured out how to get a pop-up message if a certain condition is true (see below code)

    // checks if the fieldname checkbox is checked and if so displays an alert
    if (crmForm.all.fiieldname.DataValue == "1") {
    alert("ALERT: This person is known to meet the condition.  click OK to dismiss.");
    }
    // checks if fieldname2 is checked and if so displays a different checkbox
    if (crmForm.all.fieldname2.DataValue == "1") {
    alert("ALERT: This person is known to meet a different condition.  take a different action.");
    }

    2.  having trouble with below code to pop up a box if the "winx_alerts" field is greater than or equal to 25 but not empty

    // gets text  of the Alerts text box on the form
    var text = crmForm.all.winx_alerts.DataValue;
    // check if the length of the text if empty or 0 value return 0 else if length of text is 25 chrarcters or greater display the alert
    if (text.length == 0) {retrun 0;
    } else if (text.length >= 25) {
     alert("ALERT: You might want to check the Alerts & Warnings tab of this person for special handeling instructions.")
    }
    }

    so my next question is am I coding the JScript wrong here?  My objective is that if the value in the field is 25 characters or more in length (a reasonable length for a somewhat vague alert such as "CX Uses iPad to communicate", "Security Alert: Abusive Customer, disconnect or XFR to super.", etc. if the alert is not 25 or more characters in length then do nothing.

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 70 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

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

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 32 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans