Asked by:
Unable to populate records more than 50 in silverlight textbox

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
-
You might find some help here: http://blogs.msdn.com/b/crminthefield/archive/2012/03/16/how-to-increase-the-50-record-page-limit-on-odata-retrieve-responses-for-dynamics-crm-2011.aspx
Rune Daub Senior Consultant - Dynateam CRM http://www.dynateam.dk
- Proposed as answer by RuneDaub Monday, July 14, 2014 11:35 AM
Monday, July 14, 2014 11:35 AM -
Hi,
The REST endpoint of CRM (OData) has the 50 record limit. Have a look here on how to remove it : http://blogs.msdn.com/b/crminthefield/archive/2012/03/16/how-to-increase-the-50-record-page-limit-on-odata-retrieve-responses-for-dynamics-crm-2011.aspx
However, if you're using CRM Online, the only way would be to keep making requests based on whether more records are present until you get all of them.
Monday, July 14, 2014 12:00 PM -
Hi RuneDaub,
I have seen that link too but that isn't working...
Anything else can you please guide me......
Thanks & Regards,
Gopinath V.
Gopinath V.
Wednesday, July 16, 2014 8:49 AM -
Hi Dynamotion,
I have checked this link too but nothing worked out then only i posted in forum.
Anything else can you help me in this.
Gopinath V.
Wednesday, July 16, 2014 8:50 AM -
Hi,
Did you try the steps given in the link to update the default limit?
Wednesday, July 16, 2014 8:57 AM