Closed ryanspain closed 1 year ago
Ah. Nice bug found. I'd love a PR!
Will your PR give more/better than this? 😉 (Sorry, I had to find an easy solution...)
Just wondering... Why do you have 5000+ views?? 😲
@rappen, it might be easier to just use Fetch XML to retrieve the views because pagination already implemented in RetrieveMultiple(string fetch) as the default behavior. The query isn't complex.
But I'm also in favor of updating RetrieveMultiple(QueryBase query) to, by default, include all records. Less records can be returned by setting the PageInfo.Count
for the query being passed in. The need for an allRecords
flag or similar could then be removed.
I have an IOrganizationService.RetrieveMultipleRecursively(QueryBase query)
extension method I use for scenarios like this. It could be dropped into RetrieveMultiple(QueryBase query).
I'll work on a PR for this at the weekend.
If I can figure out why there are 7079 views in this environment @rappen, I'll let you know.
For now, it remains a mystery 🔮
As a comparison though, a vanilla Dataverse environment (No first-party apps) contains 1688 views as of today.
I guess your extension is like this, right? https://github.com/rappen/Rappen.XTB.Helper/blob/main/Rappen.XRM.Helpers/Extensions/ServiceExtensions.cs#L51-L79
Exactly. I guess that makes this easier given this repo references Rappen.XRM.Helpers
as a submodule! Nice one.
So I go back to my previous suggestion.... 😉
Problem
When the Select View dialog data is being hydrated, only the first 5000 views from the target environment are retrieved, order descending by name. This leaves view 5001+ excluded from the View selector.
I'm working in an environment that has over 5000 views (
savedqueries
). I need to name my views wisely to have them appear in Fetch XML Builder :)Cause
The RetrieveMultiple(QueryBase query) called by LoadViews in FXBQueries.cs is handing off to the service clients
RetrieveMultiple
method which by default does not handle pagination where more results exist.Solutions
I see 2 solutions here:
QueryBase
version.QueryExpression
andQueryByAttribute
types.Next steps
I'm happy to submit a PR to address this. Thoughts?