Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Hi I have 10 sharepoint lists.structure,column name,data type all are same. I need to check whether a particular item is found in any list then do some action using ecmascript.

     var arraylist=["A","B",.......];
     for(var i=0;i<arraylist.length;i++)
       {
        //using caml query here and loading collection

       }
      clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));

      function onQuerySucceded()
      {
       var count=this.colllistitem.get_count();
       if(count!=0)
       //**How can I put a break here?.Item exists..I dont want any more iteration..**
      }

Pls help me how can I apply a break there ..I dont want any further iteration of arraylist.

share|improve this question
    
If you declare a global variable which you set when count!=0 and then test it on your iteration to stop it, does it work? –  user16484 Jun 14 '13 at 16:43
    
ok.I will give it a try. –  coder1 Jun 14 '13 at 16:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.