Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multicurrency query issue #11

Open
ddean2 opened this issue Jan 21, 2015 · 0 comments
Open

Multicurrency query issue #11

ddean2 opened this issue Jan 21, 2015 · 0 comments

Comments

@ddean2
Copy link

ddean2 commented Jan 21, 2015

Hello,
I am using the LREngine code for 2 custom objects - master__c, detail__c, lookupfield__c

Our org uses multicurrency and when I was attempting to sum a currency field I got the following error:
System.QueryException: Didn't understand relationship 'Master__c' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name.

This error occured in this section of code:
// Add a field selection to get the currency from the parent record if we are depositing values into a currency field
if(IsMultiCurrencyOrg() == true && needsCurrency == true){
String masterTblName = ctx.master.getDescribe().getName();
soqlProjection += ', ' + RollupOperation.Max + '(' + masterTblName +
'.' + CURRENCYISOCODENAME + ') ' + MASTERCURRENCYALIAS;
}
I believe the fix would be something like :
String relationshipFieldName = ctx.lookupField.getRelationshipName();
soqlProjection += ', ' + RollupOperation.Max + '(' + relationshipFieldName +
'.' + CURRENCYISOCODENAME + ') ' + MASTERCURRENCYALIAS;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant