0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Javascript XrmServiceToolkit.Rest.Retrieve

Posted at
    //<パターン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;
		}
	}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?