//<パターン1> 個別項目取得
var lookupFieldValue = Xrm.Page.getAttribute("new_lookupName").getValue(); //画面からLookup項目値取得
XrmServiceToolkit.Rest.Retrieve(
lookupFieldValue[0].id, "dsh_entityNameSet",
"new_field1","new_field2","new_field3",
null, function (result) { entityName = result }, XrmServiceToolkit.Common.ShowError, false);
var field1 = entityName.new_field1 != null ? entityName.new_field1.Value : null;
var field2 = entityName.new_field2 != null ? entityName.new_field2 : null;
var field3 = entityName.new_field3 != null ? entityName.new_field3 : null;
//<パターン2> 全量データ取得
if (entityGuid != "") {
//オブジェクト取得
XrmServiceToolkit.Rest.Retrieve(entityGuid, "dsh_entityNameSet", null, null, function (result) { entityName = result; }, XrmServiceToolkit.Common.ShowError, false);
//定期成約
if (!IsNull(entityName.new_optionSetfield1)) {
var optionValue = entityName.new_optionSetfield1;
var varible1 = optionValue.Value;
}
if (!IsNull(entityName.new_TypeFiled1)) {
var varible2 = entityName.new_TypeFiled1.Value;
}
}
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme