第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何使用Web Api操作AddSolutionComponent使用javascript將實體添加

如何使用Web Api操作AddSolutionComponent使用javascript將實體添加

三國紛爭 2021-04-20 17:18:10
我想使用JavaScript將自定義實體添加到Dynamics CRM中的自定義解決方案中。我已經(jīng)進行了一些研究,結果發(fā)現(xiàn)可以使用Actions來完成。 AddSolutionComponent應該可以完成這項工作,但由于出錯了,我可能出了點問題400 Request message has unresolved parameters。我要傳遞參數(shù)的實體和解決方案都使用javascript創(chuàng)建,并且可以在crm中找到它們。function associateEntityToSolution(entityId, solutionUniqueName, newSolutionId){  var param = {       'ComponentId': entityId , // newly created entity id       'ComponentType':1, // entity type      'SolutionUniqueName':solutionUniqueName,  //newly created solution id      'AddRequiredComponents':false,      'IncludedComponentSettingsValues':null  };  var req = new XMLHttpRequest();  req.open("POST", window.parent.opener.Xrm.Page.context.getClientUrl() + "/api/data/v8.2/solutions("+newSolutionId+")/Microsoft.Dynamics.CRM.AddSolutionComponent", true);  req.setRequestHeader("OData-MaxVersion", "4.0");  req.setRequestHeader("OData-Version", "4.0");  req.setRequestHeader("Accept", "application/json");  req.setRequestHeader("Content-Type", "application/json; charset=utf-8");  req.onreadystatechange = function() {      if (this.readyState === 4) {          req.onreadystatechange = null;          if (this.status === 204) {              var uri = this.getResponseHeader("OData-EntityId");              var regExp = /\(([^)]+)\)/;              var matches = regExp.exec(uri);              var newEntityId = matches[1];              associateEntityToSolution(newEntityId,entityUniqueName);          } else {              window.parent.opener.Xrm.Utility.alertDialog(this.statusText);          }      }  };  req.send(JSON.stringify(param));}我在代碼中缺少什么嗎?還有其他解決方案可以使用javascript完成工作嗎?
查看完整描述

2 回答

?
慕桂英546537

TA貢獻1848條經(jīng)驗 獲得超10個贊

網(wǎng)址:


POST [Your Org]/api/data/v9.0/AddSolutionComponent


身體:


{

    "ComponentId" : "YourComponentGuid",

    "ComponentType" : "YourComponentType", 

    "SolutionUniqueName" : "YourSolutionUniqueName",

    "AddRequiredComponents" : "false", //false or true

    "DoNotIncludeSubcomponents" : "true" //false or true

}

可以通過執(zhí)行GET請求來檢索ComponentId [Your Org]/api/data/v9.0/EntityDefinitions(LogicalName='YourEntityLogicalName')?$select=MetadataId


查看完整回答
反對 回復 2021-04-29
  • 2 回答
  • 0 關注
  • 178 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號