US - Kansas - Kansas City - CRM

Making some editable grid columns read only.

  • 1.  Making some editable grid columns read only.

    Posted 12 days ago
    Thank you everyone for attending the March 7th Kansas City CRMUG.  Here are my notes from the editable grid modification that I demonstrated.

    This is a good link describing activating editable grids.https://neilparkhurst.com/2016/12/30/dynamics-365-editable-grids/

    Here is the key blog that describes the modification itself.
    https://community.dynamics.com/crm/b/crmandunifiedservicedesk/archive/2016/12/30/dynamics-365-editable-grids-javascript-example

    // JavaScript source code
    if (typeof (SDK) === "undefined") { SDK = {}; }
    
    
    SDK.LrgLoadDetail = {};
    // Set the Grid Row to readonly
    SDK.LrgLoadDetail.setGridReadOnly = function (context) {
        context.getFormContext().getData().getEntity().attributes.forEach(
            function (attr) {
                if (attr.getName() === "lrg_latedeliveryreason" || attr.getName() === "lrg_latepickupreason") {
                    attr.controls.forEach(function (c) { c.setDisabled(false); });
                    return;
                }
                attr.controls.forEach(function (c) { c.setDisabled(true); });
    
            });
    }

    #Technical #Beginner

    ​​

    ------------------------------
    John Ross
    Senior Microsoft CRM Solutions Specialist
    Redstone Logistics
    Overland Park KS
    ------------------------------