簡體   English   中英

無法打開快速創建表單

[英]Unable to open a quick create form

在我們的Dynamics 365實例中,我們嘗試使用此處代碼示例為名為SourceAssessment的實體打開快速創建表單。

var thisEntity = {
    entityType: "SourceAssessment",
    id: Xrm.Page.data.entity.getId()
};
var callback = function (obj) {
    console.log("Created new " + obj.savedEntityReference.entityType + " named '" + 

obj.savedEntityReference.name + "' with id:" + obj.savedEntityReference.id);
}
var setName = { name: "Child account of " + Xrm.Page.getAttribute("name").getValue() 

};
Xrm.Utility.openQuickCreate("SourceAssessment", thisEntity, setName).then(callback, function 

(error) {
    console.log(error.message);
});
  • Xrm.Page.data.entity.getId()引發

    未被捕獲的TypeError:無法讀取null(...)的屬性'entity'

  • Xrm.Page.getAttribute("name").getValue()引發

    未捕獲的TypeError:無法讀取null(…)的屬性'getValue'

  • Xrm.Utility.openQuickCreate("SourceAssessment", thisEntity, setName).then(callback, function (error) {行。 Xrm.Utility.openQuickCreate("SourceAssessment", thisEntity, setName).then(callback, function (error) { console.log(error.message); });

實體邏輯名稱無效。 該值不能為null或為空,並且必須表示組織中的實體。

使用開發人員控制台執行代碼時,必須首先切換到正確的框架,以便訪問表單的Xrm.Page對象。

在Chrome中,您可以在此處切換框架:

在此處輸入圖片說明

您想要放入的框架通常稱為customScriptsFrame ,而其他時候則是編號為contentIFrames的框架。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM