1

In an org with multi currency enabled.

  1. Parent Object ISO Code set to USD
  2. Child field Amount = USD295.00
  3. Corporate Currency is set to EUR and the Conversion Rate is set to 1,0000

Debug output of Amount field (on child) using the following debug (Just to show that there are no other decimal places in the DB not being shown on the UI):

ChargentOrders__Transaction__c tran = [Select ChargentOrders__Amount__c  From ChargentOrders__Transaction__c Where ID = 'a2c20000000hAXm'];
Decimal orig = tran.ChargentOrders__Amount__c;
system.debug(orig);

orig = orig.setScale(23);
system.debug(orig);

The output is below:

enter image description here

However when the WFR runs that evaluates if the Roll-Up Summary field (transaction_total) on the parent is Equal to another field (Total) on the parent this is the output

enter image description here

For some reason the rollup is changing the value to something else. The rollup is in USD, the ISO Code on the Parent is USD.

Any ideas why the Roll-Up Summary is modifying the value yet Aggregate Querys using convert currency, not using convert currency, and just regular queries mentioned above all return 295.00?

Basically, every query I make shows a result of $295.00 with no additional decimal places. The only place where this weird number is being displayed is a WFR that evaluates if the Roll-Up Summary Field is = the Amount field. And the WFR is not evaluating to true because the value of 294.999999...128 is < the value of $295.00

Added

Per comments below I also explicitly debugged the value of the Rollup summary field (thought it was clear with the original debug of the fields being rolled up)

Code:

ChargentOrders__ChargentOrder__c ord = [Select ChargentOrders__transaction_total__c From ChargentOrders__ChargentOrder__c Where ID = 'a2Z200000021zF3'];
system.debug(ord.ChargentOrders__Transaction_total__c);

Results

enter image description here

  • Normally your questions are very clear, but I'm having a bit of a hard time following this one. The last two paragraphs specifically left me more confused. In terms of the setup, are you just rolling up one detail with 295, and it sums to 294.999...? – Adrian Larson Sep 2 '16 at 16:16
  • @AdrianLarson - Sorry for the confusion. Yes, it is rolling up One (1) transaction and the UI and query for the rollup field show 250.00 yet the WFR Debug shows 249.999999999999999999999128. I tried to clear it up. Basically a WFR is evaluating the equality of two fields. One being a RUS field and only in the WFR does it show 249.9999...128 – Eric Sep 2 '16 at 16:18
  • @AdrianLarson - Updated question, hopefully it is clearer as I see where I introduced the confusion – Eric Sep 2 '16 at 16:25
  • Eric -- your code references field ChargentOrders__Amount__c but the workflow debug references two different fields, neither being ChargentOrders__Amount__c – cropredy Sep 2 '16 at 18:15
  • @cropredy - Right, The Amount field referenced in my code is on the Child object and is what is being rolled up to the Transaction Total on the parent. I was trying to show that the field being rolled up does not contain any decimal places that are not shown in the UI that could affect the rollup – Eric Sep 2 '16 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.