Trying to convert crmForm to Xrm.Page

So I’m quite new to JavaScript and I need to upgrade this to XRM as the below code has been deprecated. Can anyone point me in the right direction?

I’m guessing a start would be Xrm.Page.ui.create

function setMinutesWorked() {
    var CRM_FORM_TYPE_CREATE = 1;
    var CRM_FORM_TYPE_UPDATE = 2;
    switch (crmForm.FormType) {
        case CRM_FORM_TYPE_CREATE:
            crmForm.all.actualdurationminutes.DataValue = null;
            break;
        case CRM_FORM_TYPE_UPDATE:
            // do nothing
            break;
    }
}

Leave a Comment