Skip to content

Commit

Permalink
issue SFDO-Community#222 - Ensure order by differentiates context used
Browse files Browse the repository at this point in the history
Even though this addresses the issue, this could appear to cause a
regression to an unsuspecting user/admin/dev since the issue this
addresses could influence existing rollups that were not respecting
proper order by but still could have "appeared" to be working.
  • Loading branch information
jondavis9898 committed Aug 13, 2015
1 parent 44f7a79 commit 4e8c39c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rolluptool/src/classes/RollupService.cls
Original file line number Diff line number Diff line change
Expand Up @@ -694,8 +694,10 @@ global with sharing class RollupService
LREngine.SharingMode.User : LREngine.SharingMode.System_x;

// Determine if an LREngine Context has been created for this parent child relationship, filter combination or underlying query type and sharing mode?
String rsfType = rsf.isAggregateBasedRollup() ? 'aggregate' : 'query';
String contextKey = lookup.ParentObject__c + '#' + lookup.RelationshipField__c + '#' + lookup.RelationShipCriteria__c + '#' + rsfType + '#' + sharingMode;
String rsfType = rsf.isAggregateBasedRollup() ? 'aggregate' : 'query';
String orderBy = String.isBlank(Lookup.FieldToOrderBy__c) ? '' : Lookup.FieldToOrderBy__c;
String contextKey = lookup.ParentObject__c + '#' + lookup.RelationshipField__c + '#' + lookup.RelationShipCriteria__c + '#' + rsfType + '#' + sharingMode + '#' + orderBy;

LREngine.Context lreContext = engineCtxByParentRelationship.get(contextKey);
if(lreContext==null)
{
Expand Down

0 comments on commit 4e8c39c

Please sign in to comment.