2

When I go thorough this critical update's description it says,

Previously, our calculations on percent values weren’t always working as expected. We rolled out a partial fix earlier, and this release we’re rolling out the rest of it in the form of a critical update. Why? We know that many of you have workarounds in place to make sure the flow calculates correctly. Since our change makes those workarounds unnecessary, this is your chance to test how the current state of percent calculations works for each of your flows.

Before, values added to an sObject variable’s percentage field were automatically divided by 100. For example, if you assigned a number variable’s value (100) to sObject variable {!Opportunity.Probability}, the value in the sObject variable is 0.1. If you then assigned the value of {!Opportunity.Probability} (.1) to another sObject variable {!Opportunity2.Probability}, the value is converted from 0.1 to 0.001! If you saved that value to an opportunity record, the percent field’s value would be rounded up to 0%. Yikes!

When I created an opportunity by setting 40 as probability, as per the example it should show 0.04 in detail page. But I see 40%. So is it fixed in previous roll outs or am I checking the wrong functionality?

And in the example it is mentioned;
assigned the value of {!Opportunity.Probability} (.1) to another sObject variable {!Opportunity2.Probability}
How to access Opportunity2.Probability object? Is it a typo?

Once you activate this critical update, percentage fields in sObject variables are much better-behaved. You’re no longer in danger of your value shrinking down from 100 to 0.001 as you pass the value between sObject variables.

  1. When you pass a numerical value into an sObject variable’s percent field, the value is exactly the same. 100 remains 100. If you save this value to a new or existing record, the percent value is 100%.
  2. When you pass the value of one sObject variable’s percent field into the percent field of another sObject variable, the value is exactly the same. 100 remains 100. If you save this value to a new or existing record, the percent value is 100%.
  3. When you reference an sObject variable’s percent field in a formula, the value is divided by 100. This is because formulas expect percent values to be in decimal form. 100% becomes 1.0. If you save this value to a new or existing record, the percent value is 1%. If you’re saving this value to a new or existing Salesforce record, we recommend multiplying it by 100.

Point 1 and 2 are already working in my sandbox and we have not activated this update.

I created a record from 'execute anonymous window' with percentage field set as 40 and I see it as 40 in detail page.

So the scope of this critical update is only for the formula fields which refer percentage fields in it i.e. point 3 and point 1 and 2 are already activated?

Thank you.

1

How to access Opportunity2.Probability object? Is it a typo?

No, they're variable names. It doesn't help that they named the first variable Opportunity, which is likely the source of your confusion. They're talking about a flow with two variables.

I created a record from 'execute anonymous window' with percentage field set as 40 and I see it as 40 in detail page.

Execute anonymous isn't the problem. Flows are. This critical update is intended to align the way flows work with the way percentage fields work in the rest of the platform, and do so reliably (hence the "trust").

So the scope of this critical update is only for the formula fields which refer percentage fields in it i.e. point 3 and point 1 and 2 are already activated?

It's in reference to Flow formula fields. Normal formula fields work correctly and do not need to be fixed.

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.