Skip to main content

Notifications

Service | Customer Service, Contact Center, Fie...
Unanswered

Knowledge Article Template Creation Errors

Posted on by 14
Hi! I am unable to create a Knowledge Article Template.  When I select /New,/ I get a /One of the scripts for this record has caused an error. For more details, download the log file./ error.  I click /ok/ and it lets me select English - USA.  Then I can create a template.  When I click either /Save/ or /Save and close,/ I get an /An unexpected error occurred from ISV code./  I do not know how to track this down or gain an understanding of the problem.  Can anyone help?
 
I downloaded the .txt files associated with the errors.
 
Error 1:  One of the scripts for this record has caused an error. 
 
TypeError: Cannot read properties of null (reading 'setDisabled')
    at d.onLoad (https://kenzen.crm.dynamics.com/%7b638452155280000196%7d/webresources/msdyncrm_/KnowledgeManagementFeatureWebResource/KnowledgeArticleTemplate/KnowledgeArticleTemplateMainSystemLibrary.js:1:1670)
    at y._executeFunctionInternal (https://content.powerapps.com/resource/uci-infra/scripts/app.1211c8178aed6627efd7620b582acf2d.js:14:1233194)
    at y.execute (https://content.powerapps.com/resource/uci-infra/scripts/app.1211c8178aed6627efd7620b582acf2d.js:14:1231628)
    at https://content.powerapps.com/resource/uci-infra/scripts/app.1211c8178aed6627efd7620b582acf2d.js:4:155346
    at i (https://content.powerapps.com/resource/uci-infra/scripts/app.1211c8178aed6627efd7620b582acf2d.js:14:95798)
    at ne._executeIndividualEvent (https://content.powerapps.com/resource/uci-infra/scripts/app.1211c8178aed6627efd7620b582acf2d.js:4:155320)
    at ne._executeEventHandler (https://content.powerapps.com/resource/uci-infra/scripts/app.1211c8178aed6627efd7620b582acf2d.js:4:152138)
    at Object.execute (https://content.powerapps.com/resource/uci-infra/scripts/app.1211c8178aed6627efd7620b582acf2d.js:4:149329)
    at w._executeSyncAction (https://content.powerapps.com/resource/uci-infra/scripts/app.1211c8178aed6627efd7620b582acf2d.js:14:592280)
    at w._executeSync (https://content.powerapps.com/resource/uci-infra/scripts/app.1211c8178aed6627efd7620b582acf2d.js:14:592007)
Error Details:
Event Name: onload
Function Name: KnowledgeManagement.CommandBarActions.Instance.onLoad
Web Resource Name: msdyncrm_/KnowledgeManagementFeatureWebResource/KnowledgeArticleTemplate/KnowledgeArticleTemplateMainSystemLibrary.js
Solution Name: msdynce_KnowledgeManagementFeatures
Publisher Name: microsoftdynamics
 
 
Error 2:  An unexpected error occured from ISV code
 
Exception Message: Invalid language. Please select a valid language.​
ErrorCode: -2147220956
HexErrorCode: 0x80040224
ErrorDetails: 
    ApiExceptionSourceKey: Plugin/Microsoft.Dynamics.KnowledgeArticleFeatures.Plugins.PreOperationKnowledgeArticleTemplateCreate
    ApiStepKey: 337013f4-2f00-4885-8250-a531963e074c
    ApiDepthKey: 1
    ApiActivityIdKey: a6c9d4d8-d13c-4dec-b4e9-c064696325ba
    ApiPluginSolutionNameKey: msdynce_KnowledgeManagementFeatures
    ApiStepSolutionNameKey: msdynce_KnowledgeManagementFeatures
    ApiExceptionCategory: ClientError
    ApiExceptionMessageName: IsvUnExpected
    ApiExceptionHttpStatusCode: 400
HelpLink: http://go.microsoft.com/fwlink/?LinkID=398563&error=Microsoft.Crm.CrmException%3a80040224&client=platform
TraceText: 
    [Microsoft.Dynamics.KnowledgeArticleFeatures.Plugins: Microsoft.Dynamics.KnowledgeArticleFeatures.Plugins.PreOperationKnowledgeArticleTemplateCreate]
    [337013f4-2f00-4885-8250-a531963e074c: PreOperation of knowledge article template Create]
    Entered Microsoft.Dynamics.KnowledgeArticleFeatures.Plugins.PreOperationKnowledgeArticleTemplateCreate.Execute(), Correlation Id: 08f45fd3-f3de-40a0-8a45-2da6827c3c95, Initiating User: 75909330-19f2-ed11-8849-000d3a9b75f2
    Exiting Microsoft.Dynamics.KnowledgeArticleFeatures.Plugins.PreOperationKnowledgeArticleTemplateCreate.Execute(), Correlation Id: 08f45fd3-f3de-40a0-8a45-2da6827c3c95, Initiating User: 75909330-19f2-ed11-8849-000d3a9b75f2
Activity Id: b7adf7b0-44a3-479a-8b81-11d801992f96
  • Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    Knowledge Article Template Creation Errors
    Hi Partner,
    All user can't create template? same error?
    Have you tried to clear cache of the browser to test again?
    And you mentioned the js--KnowledgeArticleTemplateMainSystemLibrary.js
    I found it in my environment, you can refer to this:
    var ODataContract;(function(b){var a=function(){function a(a){this.TemplateId=a}a.prototype.getMetadata=function(){var a={boundParameter:null,parameterTypes:{TemplateId:{typeName:"Edm.String",structuralProperty:1}},operationName:"msdyn_GetKAObjectFromTemplate",operationType:0};return a};return a}();b.msdyn_GetKAObjectFromTemplate=a})(ODataContract||(ODataContract={}));var KnowledgeManagement;(function(b){var a=function(){function a(){}a.ChooseLanguageDialogUniqueName="KMChooseLanguage";a.KATemplateLogicalName="msdyn_knowledgearticletemplate";a.LanguageLookupId="translateLanguageLocale_id";a.lastButtonClicked="param_lastButtonClicked";a.languageDetails="param_selectedLanguage";a.languageNameControl="header_msdyn_LanguageLocaleIdName";a.languageIdControl="msdyn_languagelocaleid";a.subjectId="msdyn_subjectid";a.OK_ID="ok_id";a.CANCEL_ID="cancel_id";a.templateDetails="param_msdyn_knowledgearticletemplateId";a.tempDescCheck="---";a.SelectKnowledgeArticleTemplateUniqueName="SelectKnowledgeArticleTemplate";a.languageResponse="_languagelocaleid_value";a.subjectResponse="_subjectid_value";a.selectTemplateLookupId="selectTemplate_id";a.KnowledgeArticleLogicalName="knowledgearticle";return a}();b.Constants=a;var c=function(){function a(){}a.TelemetryEvent_EventOnLoad="OnLoad";a.TelemetryEvent_CreateArticleFromTemplate="CreateArticleFromTemplate";a.TelemetryEvent_LinkLookupForArticle="LinkLookupForArticle";a.TelemetryEvent_OpenLanguageDialog="OpenLanguageDialog";return a}();b.TelemetryConstants=c;var d=function(){function d(){var e=this;this.onLoad=function(){Xrm.Page.ui.getFormType()==1&&e.openLanguageDialog();Xrm.Page.getControl(a.languageNameControl).setDisabled(true)};this.openLanguageDialog=function(){var b={height:300,width:500,position:1};Xrm.Navigation.openDialog(a.ChooseLanguageDialogUniqueName,b).then(function(b){if(b&&b.parameters&&b.parameters[a.lastButtonClicked]==a.OK_ID)e.handleFormChanges(b.parameters);else Xrm.Page.ui.close()},function(a){d.actionFailedCallbackForMoca(a,c.TelemetryEvent_OpenLanguageDialog)})};this.handleFormChanges=function(f){var d=f[a.languageDetails];if(d){var e=JSON.parse(d),c=Xrm.Page.getControl(a.languageIdControl)&&Xrm.Page.getControl(a.languageIdControl).getAttribute(),b=Xrm.Page.getControl(a.languageNameControl)&&Xrm.Page.getControl(a.languageNameControl).getAttribute();if(c&&b){c.setValue(e.id.replace(/[{}]/g,""));b.setValue(e.name);Xrm.Page.getControl(a.languageNameControl).setDisabled(true)}}};this.onDialogSaveHelper=function(){var e=Xrm.Page.getControl(a.LanguageLookupId),c=e.getAttribute()&&e.getAttribute().getValue(),d=null;if(c&&c.length>0)d=JSON.stringify(c[0]);else{var f={text:b.ResourceStringProvider.getResourceString("KnowledgeArticle_SelectLanguage_SelectLanguageMessage")},g={width:600,height:150,position:1};Xrm.Navigation.openAlertDialog(f,g);return}Xrm.Page.data.attributes.get(a.languageDetails).setValue(d);Xrm.Page.ui.close()};this.onDialogSave=function(){var b=Xrm.Page.data.attributes.get(a.lastButtonClicked);b&&b.setValue(a.OK_ID);e.onDialogSaveHelper()};this.onDialogCancel=function(){var b=Xrm.Page.data.attributes.get(a.lastButtonClicked);b&&b.setValue(a.CANCEL_ID);Xrm.Page.ui.close()};this.onDialogTemplateCancel=function(){var c=Xrm.Page.data.entity&&Xrm.Page.data.entity.attributes.get("description"),b=Xrm.Page.data.attributes.get(a.lastButtonClicked);if(b){b.setValue(a.CANCEL_ID);c&&c.setValue("")}Xrm.Page.ui.close()};this.openSelectKATemplateDialog=function(){var b={entityName:"knowledgearticle",entityId:null},c={description:a.tempDescCheck};Xrm.Navigation.openForm(b,c)};this.knowledgeArticle_onload=function(){var b=null,f=false;if(Xrm.Page.data.entity&&Xrm.Page.data.entity.attributes.get("description")){b=Xrm.Page.data.entity.attributes.get("description").getValue();if(b)f=b===a.tempDescCheck}if(Xrm.Page.ui.getFormType()==1&&b!=null&&f){var g={height:300,width:500,position:1};Xrm.Navigation.openDialog(a.SelectKnowledgeArticleTemplateUniqueName,g).then(function(b){var c=Xrm.Page.data.entity&&Xrm.Page.data.entity.attributes.get("description");c&&c.setValue("");b&&b.parameters&&b.parameters[a.lastButtonClicked]==a.OK_ID&&e.createArticleFromTemplate(b.parameters)},function(a){d.actionFailedCallbackForMoca(a,c.TelemetryEvent_EventOnLoad)})}};this.createArticleFromTemplate=function(g){var f=g[a.templateDetails];if(f){var h=new ODataContract.msdyn_GetKAObjectFromTemplate(f),b=[];b.push(Xrm.WebApi.online.execute(h).then(function(a){return a.json()}));b.push(Xrm.Utility.getEntityMetadata(a.KnowledgeArticleLogicalName));Promise.all(b).then(function(g){var a=null,f;if(g[0])a=g[0];if(g[1])f=g[1];if(f!=null&&a!=undefined&&a!=null){var c=f._entityDescriptor.AttributeNames;if(c!=null){for(var b in c)if(a[c[b]]!=undefined&&a[c[b]]!=null){var k=c[b].toString(),i=Xrm.Page.data.entity&&Xrm.Page.data.entity.attributes.get(k);i&&i.setValue(a[c[b]])}var d=f._entityDescriptor.ManyToOneRelationships;if(d&&a)for(var b in d)if(d[b].ReferencingAttribute){var l=d[b].ReferencedEntity,h=d[b].ReferencingAttribute,j="_"+h+"_value";a[j]&&e.linkLookupForArticle(l,a[j],h)}}}},function(a){d.actionFailedCallbackForMoca(a&&a.innerror||a,c.TelemetryEvent_CreateArticleFromTemplate)})}};this.linkLookupForArticle=function(a,e,b){a&&Xrm.Utility.getEntityMetadata(a).then(function(c){var d="?$filter="+c.PrimaryIdAttribute+" eq "+e+"";Xrm.WebApi.retrieveMultipleRecords(a,d).then(function(e){var d;if(e&&e.entities.length>0)d=e.entities[0];if(d&&c){var i=c.PrimaryNameAttribute,j=d[i],k=d[c.PrimaryIdAttribute],f=Xrm.Page.getAttribute(b);if(f!=null){var g={entityType:a,id:k,name:j},h=[g];f.setValue(h)}}},function(){})},function(a){d.actionFailedCallbackForMoca(a,c.TelemetryEvent_LinkLookupForArticle)})};this.selectTemplateFromDialog=function(){var b=Xrm.Page.data.attributes.get(a.lastButtonClicked);b&&b.setValue(a.OK_ID);e.createArticleTemplateOkClick()};this.createArticleTemplateOkClick=function(){var f=Xrm.Page.getControl(a.selectTemplateLookupId),c=f.getAttribute(),d=null;if(c){var e=c.getValue();if(e)d=e[0].id;else{var g={text:b.ResourceStringProvider.getResourceString("KnowledgeArticle_SelectTemplate_SelectTemplateMessage")},h={width:600,height:150,position:1};Xrm.Navigation.openAlertDialog(g,h);return}}Xrm.Page.data.attributes.get(a.templateDetails).setValue(d);Xrm.Page.ui.close()}}d.getFormContext=function(a){if(a==null||a==undefined)return Xrm.Page;else return a.getFormContext()};d.reportFailureEvent=function(a,c,e,b,d){var a=a+"."+c;Xrm.Reporting.reportFailure(a,e,b,d)};d.actionFailedCallbackForMoca=function(b,a){Xrm.Utility.closeProgressIndicator();d.actionFailedCallback(a,b)};d.actionFailedCallback=function(c,b){if(b){d.reportFailureEvent(a.KnowledgeArticleLogicalName,c,{name:c,message:b.hasOwnProperty("message")?b.message:b.toString()});var e={errorCode:b.errorCode,message:b.message};Xrm.Navigation.openErrorDialog(e)}};return d}();b.KnowledgeCommandBarActions=d;var e=function(){function a(){}a.Instance=new d;return a}();b.CommandBarActions=e})(KnowledgeManagement||(KnowledgeManagement={}))
    Also, you can open one ticket for Microsoft support team if they are still does not work.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans