문제

I am creating a new list item using CSOM. When I try updating a Person field, I'm getting a error saying my function is undefined

Uncaught ReferenceError: createListItem is not defined

it happens with the introduction of this line:

SP.User _newUser = clientContext.Web.EnsureUser("domain\\user");

Isn't this part of Sp.js? I have this imported along with sp.core.

도움이 되었습니까?

해결책

Try this

var context = SP.ClientContext.get_current();
var theUser = context.get_web().ensureUser("DEV\testowner");
context.load(theUser);

context.executeQueryAsync(function(){
    //Create list item here
},
function(sender, args){
  alert(args.get_message());
});
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top