1

Why is this formula on the child object not working? I've created a number field formula on the child (Days_from_Project_Creation__c) and a roll up number field (Opportunity__r.Latest_Create_Date_of_PL__c) on the parent. Both fields are populated correctly. Below is the formula field on the child object that is not working.

IF(Opportunity__r.Latest_Create_Date_of_PL__c = Days_from_Project_Creation__c, TRUE, FALSE)
1

Try rounding the formula/roll-up summary fields before comparing them. Even though the decimal places are set to the same value, they aren't rounded to that value until after all the calculations are completed--so even though they may look the same when you display them in a page layout, they aren't the same in the calculation. So:

ROUND(Opportunity__r.Latest_Create_Date_of_PL__c) = ROUND(Days_from_Project_Creation__c)

(Also note that you don't need an IF function to return True or False here -- the comparison returns this implicitly.)

  • Wait, it seems like this is now not working when there are multiple child objects on the parent... Why would that be? – wayne-m May 14 '15 at 16:35
  • Hm... is the roll-up summary field displaying the right value on the parent record? – shannonsans May 14 '15 at 18:24
1

This might be it:

I have had this issue before -- the internal value on the child object may actually be, for example, 9.999999999999998 instead of 10, the value displayed. You can see this by doing soql on the field. The number of decimal places is used for rounding, not absolute precision when calculations are done. The RSF will roll up the exact decimal number on the child, not its rounded value.

0

This looks odd. But please check if number of digits after decimal point is same for both fields. Also try to put both fields in page layout and manually compare both values to ensure that, both are setting correctly.

  • Both are set to 0 decimal places, and when looking manually, the numbers are indeed the same! It's driving me nuts. The parent object is set to Data Type: Number, 18 character length, and 0 decimal places. The child object is set to formula type: Number 0 decimal places. – wayne-m May 12 '15 at 20:30
  • 1
    Temporarily create a formula field of text type with value Opportunity__r.Latest_Create_Date_of_PL__c+" "+Days_from_Project_Creation__c. It will show the value that is coming inside formula. Then you can find if there is any mismatches. – Victor May 12 '15 at 20:50
0

Try: IF(Opportunity__r.Latest_Create_Date_of_PL__c - Days_from_Project_Creation__c == 0, TRUE, FALSE)

  • 1
    Note that IF(condition, true, false) will evaluate the same as condition. – Adrian Larson May 14 '15 at 1:38

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.