Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Uncaught Error: The property or field has not been initialized.
  2. It has not been requested or the request has not been executed.
  3. It may need to be explicitly requested.
  4.  
  5. var CustomAction = function(){
  6.  
  7. var clientContext = new SP.ClientContext.get_current();
  8. var web = clientContext.get_web();
  9. this.oList = web.get_lists().getByTitle("Classification");
  10.  
  11. // .load() tells CSOM to load the properties of this object
  12. // multiple .load()s can be stacked
  13. clientContext.load(oList);
  14.  
  15. // now start the asynchronous call and perform all commands
  16. clientContext.executeQueryAsync(Function.createDelegate(this, this.onSuccess), Function.createDelegate(this, this.onFailure));
  17.  
  18. // method will exit here and onSuccess or OnFail will be called asynchronously
  19.  
  20. };
  21.  
  22. function onSuccess(sender, args) {
  23. alert('No of rows: ' + oList.get_itemCount());
  24. };
  25.  
  26. function onFail(sender, args) {
  27. alert('Request failed.n' + args.get_message() + 'n' + args.get_stackTrace());
  28. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement