-2
最近、CRM 2013からCRM 2015に移行し、新しいケースでアカウント/ビジネスフィールドを選択するときに、[メンテナンスレベル]が自動入力されなくなりました。これは、ケース:新しいケースフォームではなく情報フォームです。アカウントフィールドには、保守レベルを更新して関数呼び出しのサービスレベルと一致するように、onchange
イベントが明確に表示されます。 新しいケースを追加するときにメンテナンスレベルが自動で設定されなくなる
保守レベルのプロパティ
function setMaintLevelFromAccount(){
if (SDK.REST){
// only set if not already populated.
var custID = Xrm.Page.getAttribute("customerid").getValue();
var maintLevel = Xrm.Page.getAttribute("contractservicelevelcode").getValue();
// if customer is populated and maint level is blank, default maint level from account
if (custID != null){
var odataOptions = "";
//odataOptions = "$select=Name,PriceLevelId&$filter=Name eq '" + custID. + "' and StateCode/Value eq 0";
odataOptions = "$select=am_servicelevel&$filter=AccountId eq guid'" + custID[0].id + "'";
try {
SDK.REST.retrieveMultipleRecords("Account", odataOptions,
function (data){
// if zero results and had name, try running with no name to get the latest..
if (data.length > 0){
var maint = data[0].am_servicelevel.Value;
Xrm.Page.getAttribute("contractservicelevelcode").setValue(maint);
}
else {
Xrm.Page.getAttribute("contractservicelevelcode").setValue(null);
}
},
function (error){
// alert ("error: " + error.message);
},
function (complete){
});
}
catch (err) {
}
}
}
}
これは既知の問題ですか?アクティビティオフラインで問題を解決するために0.1アップデートを適用しましたが、それ以上のアップデートはまだ適用されていません。
_setMaintLevelFromAccount_機能はどのように見えますか? –
上記のsetMaintLevelFromAccount関数を追加しています。 –
try catchを削除して(FYI:empty catch = bad code)、何かエラーが表示されたら – Alex