You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
The text was updated successfully, but these errors were encountered:
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;
The text was updated successfully, but these errors were encountered: