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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Upper Case

(0) ShareShare
ReportReport
Posted on by 250

Hello Everyone.

i have a question. i need to turn the text of two fields in upper case when i update the field.

i have this code but its not working, or if someone have a diferent code to turn  the text of string field to Upper Case appreciate.

function UpperCase(){
    var FIELDS_TO_UPDATE = ["Nome", "Descrição"]; //Update the field values to your field names
    function onLoad() {
    setToUpperCase(FIELDS_TO_UPDATE);
    }
    function setToUpperCase(fields) {
    for (var i in fields) {
        var str = Xrm.Page.getAttribute(fields[i]).getValue();
        var Upper = str.toUpperCase();
        Xrm.Page.getAttribute(fields[i]).setValue(Upper);
    }
    }
}

*This post is locked for comments

I have the same question (0)
  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Upper Case

    Hi,

    Try to call below method on change of the fields , just replace the filename in below method.

    function setUppercase()

    {

    var str1=Xrm.Page.getAttribute(fieldname1).getValue();

    if(str1 !=null)

    {

    str1 = str1.toUpperCase();

    Xrm.Page.getAttribute(fieldname1).setValue(str1);

    }

    var str2=Xrm.Page.getAttribute(fieldname2).getValue();

    if(str2 !=null)

    {

    str2 = str2.toUpperCase();

    Xrm.Page.getAttribute(fieldname2).setValue(str2);

    }

    }

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans