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 Lookup項目Details取得//Lookup項目に値設定

Posted at
//Lookup項目Details取得
if (Xrm.Page.data.entity.attributes.get("fieldname").getValue() != null) {
   var CustomerId = Xrm.Page.data.entity.attributes.get("fieldname").getValue()[0].id;
   var CustomerName = Xrm.Page.data.entity.attributes.get("fieldname").getValue()[0].name;
   var CustomerType = Xrm.Page.data.entity.attributes.get("feildname ").getValue()[0].entityType;
}


//Lookup項目に値設定
var formContext = executionContextObj.getFormContext();
var loginUserId = Xrm.Utility.getGlobalContext().userSettings.userId;
loginUserId = loginUserId.replace('{', '').replace('}', '');
var loginName = Xrm.Utility.getGlobalContext().userSettings.userName;
 
var systemUserLookUp = new Array();
systemUserLookUp[0] = new Object();
systemUserLookUp[0].id = loginUserId;
systemUserLookUp[0].name = loginName;
systemUserLookUp[0].entityType = "systemuser";

formContext.getAttribute("new_lookupuser").setValue(systemUserLookUp);
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?