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)

Regarding Error on Quick Create Cancel

(0) ShareShare
ReportReport
Posted on by 362

Hi Team,

Platform throwing an exception while clicking on "Cancel" button on one of the Quick Create Form. We are experiencing this issue for the first time only. Following is the error log.

Microsoft Dynamics CRM Error Report Contents

<CrmScriptErrorReport>
<ReportVersion>1.0</ReportVersion>
<ScriptErrorDetails>
<Message>Unable to get property 'initializeFields' of undefined or null reference</Message>
<Line>0</Line>
<URL>/form/page.aspx?lcid=1033&themeId=8f290b97-6706-4608-89dc-193d3e6c68b9&tstamp=7984019&updateTimeStamp=636080556338844488&userts=131395666528720421&ver=363729064#_gridType=1085&create=False&etc=1085&id=%7b5E8CCD99-0AA8-4842-B608-08A2CD14D52E%7d&pagemode=iframe&rskey=%7b3A62E600-5525-4456-ACC5-98932B41B1DC%7d&theme=Outlook15White&counter=1495093285183</URL>
<PageURL>/form/page.aspx?lcid=1033&themeId=8f290b97-6706-4608-89dc-193d3e6c68b9&tstamp=7984019&updateTimeStamp=636080556338844488&userts=131395666528720421&ver=363729064#_gridType=1085&create=False&etc=1085&id=%7b5E8CCD99-0AA8-4842-B608-08A2CD14D52E%7d&pagemode=iframe&rskey=%7b3A62E600-5525-4456-ACC5-98932B41B1DC%7d&theme=Outlook15White&counter=1495093285183</PageURL>
<Function>anonymous(exc){var$v_0=Mscrm.TurboForm.Control.CustomScriptsManager.isExceptionFromOOBWebResource(exc,Mscrm.TurboForm.Control.CustomScriptsManager.get_instance().$Bx_1);if($v_0){catchError(exc.message,window.location.href,0,true);}else{var$v_1=Mscrm.Turbo</Function>
<FunctionRaw>function(exc) {
var $v_0 = Mscrm.TurboForm.Control.CustomScriptsManager.isExceptionFromOOBWebResource(exc, Mscrm.TurboForm.Control.CustomScriptsManager.get_instance().$Bx_1);
if ($v_0) {
catchError(exc.message, window.location.href, 0, </FunctionRaw>
<CallStack>
<Function>anonymous(exc){var$v_0=Mscrm.TurboForm.Control.CustomScriptsManager.isExceptionFromOOBWebResource(exc,Mscrm.TurboForm.Control.CustomScriptsManager.get_instance().$Bx_1);if($v_0){catchError(exc.message,window.location.href,0,true);}else{var$v_1=Mscrm.TurboForm.Control.CustomScriptsManager.getScriptErrorMessage(exc);if(!IsNull(exc.stack)){var$v_3=exc.stack.split('\n');if(!IsNull($v_3[0])&&!IsNull($v_3[1])){var$v_4=$v_3[0];var$v_5=$v_3[1];$v_1=$v_4.trim()+''+$v_5.trim();}}var$v_2=Mscrm.ErrorInformation.createExtendedErrorInfo('0x8063111B',null,exc.stack,[$v_1]);openErrorDlg('0x8063111B',null,$v_2,0,0);}}</Function>
<Function>RunHandlerInternal(method,parameters,executionContext,executeIfAvailableOnly)</Function>
<Function>RunHandlers()</Function>
<Function>OnScriptTagLoaded(url)</Function>
<Function>anonymous(){OnScriptTagLoaded(url);}</Function>
</CallStack>
</ScriptErrorDetails>
<ClientInformation>
<BrowserUserAgent>Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; Tablet PC 2.0; rv:11.0) like Gecko</BrowserUserAgent>
<BrowserLanguage>en-US</BrowserLanguage>
<SystemLanguage>en-US</SystemLanguage>
<UserLanguage>en-US</UserLanguage>
<ScreenResolution>1600x900</ScreenResolution>
<ClientName>Web</ClientName>
<ClienState>Online</ClienState>
<ClientTime>2017-05-18T13:11:36</ClientTime>
</ClientInformation>
<ServerInformation>
<OrgLanguage>1033</OrgLanguage>
<OrgCulture>1033</OrgCulture>
<UserLanguage>1033</UserLanguage>
<UserCulture>1033</UserCulture>
<OrgID>{3D25EF73-71A7-44F3-AB20-E121B0DCB762}</OrgID>
<UserID>{71A3EEC0-8762-E511-80F8-3863BB357FC0}</UserID>
<CRMVersion>8.1.1.977</CRMVersion>
</ServerInformation>
</CrmScriptErrorReport>

Java script code that I have in the Quick create form

try {
    var ThyssenKrupp = ThyssenKrupp || {};
    ThyssenKrupp.Crm = ThyssenKrupp.Crm || {};
    ThyssenKrupp.Crm.ET = ThyssenKrupp.Crm.ET || {};
    ThyssenKrupp.Crm.ET.QuoteBaseUnit = ThyssenKrupp.Crm.ET.QuoteBaseUnit || {};
    if (typeof (ThyssenKrupp) == "undefined") {
        ThyssenKrupp = {
            _namespace: true,
            Crm: {
                ET: {
                    QuoteBaseUnit: {}
                }
            }
        }
    }
    ThyssenKrupp.Crm.ET.QuoteBaseUnit = {
        SetFieldsDisabledbasedOnIBU: function () {
            var existingorexternalIBU = Xrm.Page.getAttribute("tk_existingexternalibu").getValue();
            var fieldListsDisabledforExisting = new Array("tk_productcategory", "tk_manufacturer", "tk_yearofmanufacturing", "tk_serialnumber", "tk_unitstatus", "tk_street", "tk_zip");
            var fieldListsDisabledforExternal = new Array("tk_lookuptoexistingbaseunit");
            if (!existingorexternalIBU) {
                TK.SetFieldDisabled(fieldListsDisabledforExisting, true);
                TK.SetFieldDisabled(fieldListsDisabledforExternal, false);
            }
            else {
                TK.SetFieldDisabled(fieldListsDisabledforExternal, true);
                TK.SetFieldDisabled(fieldListsDisabledforExisting, false);
            }

            if (Xrm.Page.ui.getFormType() == 1) {
                ThyssenKrupp.Crm.ET.QuoteBaseUnit.ClearFields();
            }
        },

        ClearFields: function () {
            //Xrm.Page.getAttribute("tk_name").setValue(null);
            Xrm.Page.getAttribute("tk_street").setValue(null);
            Xrm.Page.getAttribute("tk_zip").setValue(null);
            Xrm.Page.getAttribute("tk_serialnumber").setValue(null);
            Xrm.Page.getAttribute("tk_yearofmanufacturing").setValue(null);
            Xrm.Page.getAttribute("tk_manufacturer").setValue(null);
            Xrm.Page.getAttribute("tk_unitstatus").setValue(null);
            Xrm.Page.getAttribute("tk_productcategory").setValue(null);
            Xrm.Page.getAttribute("tk_lookuptoexistingbaseunit").setValue(null);
        },

        OnChangeofexistingBaseUnit: function () {
            var existingBaseunitGuid = new Array();
            existingBaseunitGuid = Xrm.Page.getAttribute("tk_lookuptoexistingbaseunit").getValue();
            if (existingBaseunitGuid != null) {
                var Odata = "tk_installbaseunitSet?$select=tk_et_factoryserialnumber,tk_Manufacturer,tk_et_ProductLine,tk_et_Street1,tk_et_UnitStatus,tk_et_Yearofconstruction,tk_name,tk_et_ZIPPostalCode&$filter=tk_installbaseunitId eq guid'" + existingBaseunitGuid[0].id + "'";
                var results = TK.RetrieveODataResults(Odata);
                if (results != null) {
                    if (results[0].tk_et_factoryserialnumber != null) {
                        Xrm.Page.getAttribute("tk_serialnumber").setValue(results[0].tk_et_factoryserialnumber);
                        Xrm.Page.getAttribute("tk_serialnumber").setSubmitMode("always");
                    }

                    if (results[0].tk_Manufacturer != null) {
                        Xrm.Page.getAttribute("tk_manufacturer").setValue(results[0].tk_Manufacturer);
                        Xrm.Page.getAttribute("tk_manufacturer").setSubmitMode("always");
                    }

                    if (results[0].tk_et_ProductLine.Value != null) {
                        Xrm.Page.getAttribute("tk_productcategory").setValue(results[0].tk_et_ProductLine.Value);
                        Xrm.Page.getAttribute("tk_productcategory").setSubmitMode("always");
                    }

                    if (results[0].tk_et_Street1 != null) {
                        Xrm.Page.getAttribute("tk_street").setValue(results[0].tk_et_Street1);
                        Xrm.Page.getAttribute("tk_street").setSubmitMode("always");
                    }

                    if (results[0].tk_et_UnitStatus.Value != null) {
                        Xrm.Page.getAttribute("tk_unitstatus").setValue(results[0].tk_et_UnitStatus.Value);
                        Xrm.Page.getAttribute("tk_unitstatus").setSubmitMode("always");
                    }

                    if (results[0].tk_et_Yearofconstruction != null) {
                        Xrm.Page.getAttribute("tk_yearofmanufacturing").setValue(results[0].tk_et_Yearofconstruction);
                        Xrm.Page.getAttribute("tk_yearofmanufacturing").setSubmitMode("always");
                    }

                    //if (results[0].tk_name != null) {
                    //    Xrm.Page.getAttribute("tk_name").setValue(results[0].tk_name);
                    //    Xrm.Page.getAttribute("tk_name").setSubmitMode("always");
                    //}
                    if (results[0].tk_et_ZIPPostalCode != null) {
                        Xrm.Page.getAttribute("tk_zip").setValue(results[0].tk_et_ZIPPostalCode);
                        Xrm.Page.getAttribute("tk_zip").setSubmitMode("always");
                    }
                }
            }
            else {
                //Xrm.Page.getAttribute("tk_name").setValue(null);
                Xrm.Page.getAttribute("tk_street").setValue(null);
                Xrm.Page.getAttribute("tk_zip").setValue(null);
                Xrm.Page.getAttribute("tk_serialnumber").setValue(null);
                Xrm.Page.getAttribute("tk_yearofmanufacturing").setValue(null);
                Xrm.Page.getAttribute("tk_manufacturer").setValue(null);
                Xrm.Page.getAttribute("tk_unitstatus").setValue(null);
                Xrm.Page.getAttribute("tk_productcategory").setValue(null);
            }
        }
    }
}
catch (err) {
    if (typeof console != 'undefined') {
        console.log(err.message);
    }
}


The code that I am using to populate the Quick create form. We don't have 1:N relationship between these entities, that's why we are using the following code to open the quick create form.

var parameters = { tk_quotelineid: window.parent.Xrm.Page.data.entity.getId() };
        window.parent.Xrm.Utility.openQuickCreate("tk_quotybaseunit", null, parameters).then(function (lookup) { var subgrid = window.parent.Xrm.Page.ui.controls.get("QuoteBaseUnit"); subgrid.refresh(); }, function (error) { alert("Error:" + e.errorCode); });


Any thoughts on this issue?

*This post is locked for comments

I have the same question (0)

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
Community Member Profile Picture

Community Member 2

#1
UllrSki Profile Picture

UllrSki 2

#3
SC-08081331-0 Profile Picture

SC-08081331-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans