Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged


In updateListItem() function: Use var clientContext = new SP.ClientContext.get_current(); instead of var clientContext = new SP.ClientContext(siteUrl);. Also, make sure that you are passing display name(Not the name in URL) of list in following line: var oList = clientContext.get_web().get_lists().getByTitle("RiskMgmt");


No async:false is not a good pattern. Browsers like chrome will throw a warning see this documentation Synchronous XMLHttpRequest outside of workers is in the process of being removed from the web platform as it has detrimental effects to the end user’s experience. (This is a long process that takes many years.) Developers must not pass false for ...


I do this pretty frequently. Here is a pattern I tend to follow. function getListTitle(guidList) { var thisContext = { spContext : SP.ClientContext.get_current(), promise: new $.Deferred() }; thisContext.spWeb = thisContext.spContext.get_web(); thisContext.spList = thisContext.spWeb.get_lists().getById(guidList.toString()); thisContext....

Only top voted, non community-wiki answers of a minimum length are eligible