Please wait, loading...

 

CHANGE FIELD LABEL USING JAVASCRIPT IN MSCRM 2011 ,2013

February 14, 20141
//To Change Label When Fund Transfer Changes In Account Type
function FundTransferInAccountType() {
    var type = Xrm.Page.getAttribute( “new_accounttype”).getValue();
    if (type == 100010003) {
        var FundTransfer = Xrm.Page.getAttribute( “new_fundtransfer”).getValue();
        function changeFieldLabel(fieldName, newLabel) {
            var field = crmForm.all[fieldName + “_c”];
            if (field != null)
                crmForm.all[fieldName + “_c”].firstChild.firstChild.nodeValue = newLabel;
        }
        if (FundTransfer == 1) {
            changeFieldLabel( “new_checknumber”, “Transaction Number” );
            changeFieldLabel( “new_chequedate”, “Transaction Date” );
            Xrm.Page.getAttribute( “new_checknumber”).setRequiredLevel(“none” );
            Xrm.Page.getAttribute( “new_chequedate”).setRequiredLevel(“none” );

        }
        else if (FundTransfer == 0) {
            changeFieldLabel( “new_checknumber”, “Cheque Number” );
            changeFieldLabel( “new_chequedate”, “Cheque Date” );
            Xrm.Page.getAttribute( “new_checknumber”).setRequiredLevel(“required” );
            Xrm.Page.getAttribute( “new_chequedate”).setRequiredLevel(“required” );
        }
    }
}

SOURCE : JUST2CODE.IN
Subscribe to our YouTube channel : https://www.youtube.com/user/TheRussell2012

One comment

  • Unknown

    February 2, 2015 at 6:56 pm

    The crmform object is depreciated, so I can't understand why this is labeled "CHANGE FIELD LABEL USING JAVASCRIPT IN MSCRM 2011 ,2013" ? I do not have the 2011 SDK loaded any more, but the 2013 SDK states:

    Any code that references the crmForm object must be replaced with equivalent APIs that are included in the Xrm.Page object.

Comments are closed.

https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/Microsoftdynamics365.png?fit=640%2C651
Microsoft Dynamics Community Profile

Learn more