locked
Unable to populate records more than 50 in silverlight textbox RRS feed

  • Question

  • Hi Guys,

    I am using a silverlight application inside CRM where it needs to autopopulate records which are all available in a particular entity.

    Actually scenario is when i enter a category in a textbox its related records for that particular business unit need to populate in another textbox to select.

    But if it is more than 50 records it's not able to fetch it showing only 50 records.

    And i am using DataServiceQuery to retrieve records. below is my code used to fetch the records.

    //if i give category on change of this textbox the following code works

    private void acCategory_SelectionChanged(object sender, SelectionChangedEventArgs e)
                {
                try
                    {
                    if (acCategory.SelectedItem != null)
                        {
                        CrmServer.Load(((Entity)acCategory.SelectedItem).Id);
          }
       }
                catch (Exception ex)
                    {
                    CrmServer.showErrorDetails(ex);
                    }
                }

    public static void Load(Guid cat)
                {
                try
                    {
      DataServiceQuery<entityname> query = (DataServiceQuery<entityname>)context.entitySet.Where<entityname>(a => a.jmh_Category.Id.Value == cat && a.jmh_Store.Id == Transaction.jmh_store.Id);
      query.BeginExecute(OnComplete, query);
                   
                }
                catch (Exception ex)
                    {
                   showErrorDetails(ex);
                    }
                }

     private static void OnComplete(IAsyncResult result)
                {
                try
                    {
                       
                        DataServiceQuery<entityname> results = result.AsyncState as DataServiceQuery<entityname>;               
                        List<entityname> tmp = new DataServiceCollection<entityname>(results.EndExecute(result)).ToList<entityname>();
                        abc = null;
                        abc = from p in tmp select new Entity { Id = p.jmh_defId, Name = p.jmh_def };
                        if (Complete != null)
                            Complete(null, new EventArgs());
                    }
                catch (Exception ex)
                    {
                   showErrorDetails(ex);
                    }
                }

    In the above code "tmp" it shows only tmp.count = 50 not more than that actually more than 50 records are available.

    Please can anyone guide me how to acheive this, since this is very urgent please help me guys....

    Thanks in advance.............


    Gopinath V.



    • Edited by Gopivino Monday, July 14, 2014 5:52 AM
    Monday, July 14, 2014 5:48 AM

All replies