function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Serena SchultzSerena Schultz 

Process Builder to create Payment Records + Advanced Currency Management

Hello All!

I’m hoping you can help me with an automation. Here’s the scenario:

I have a org with Advanced Currency Management enabled. I’ve used this Salesforce resolution article (https://help.salesforce.com/articleView?id=000211817&type=1) to recreate my currently rollups and formulas from Payments to Opportunity and those all work fine.

I now have a new requirement to automate the creation of payment records using values from some custom fields that we’ve added to Opportunity. I’ve been able to do this via a process builder which fires on creation of a new Opportunity with the relevant fields populated (see below).

User-added image

When the Payment record(s) are created the “Total Payments” custom rollup is also populating correctly (see below). 
User-added image

The problem is with my Balance Due field. This field is populated using a workflow which fires on creation and edit to calculate the value (Amount - Total Payments) and then populate it into a custom currency field. (This path is due to Advanced Currency Management being enabled.)

Currently, my custom Balance Due field is not updating upon the creation of the Opportunity and Payment records. It stays set to the initial Amount - Total Payments value. If I edit and save the Opportunity record then my workflow fires and the field updates.

I think this might be an order of operations issue, since both the opportunity and payment records are being created at once, but I’m not sure. 

For the moment, I've added a scheduled action to my process builder to repopulate a field on the opportunity with its previous contents to force an edit/save which would run the workflow for my Balance Due field, but I can’t schedule that to happen any sooner than 1 hour after the records are created which is not ideal.

Any thoughts on other ways to get the Balance Due workflow to fire immediately after the records are created so that it updates correctly right away?

Thanks!
Serena
RD@SFRD@SF
Hi Serena,

I have been through a similar scenario.
I suggest the following
1. Try using a formula field instead of the workflow field update for calculating the (Amount - Total Payments).
2.  In case you are going to follow the 1 hour after the records method, change it to 0 hour it works.

Hope it helps
RD
Serena SchultzSerena Schultz
Hi RD,

Thanks for the suggestions. Unfortuantly, neither has fixed my issue...

1) I can't use forumlas with currency outputs due to having Advanced Currency Management enabled.
2) I'm also getting an invalid value when I try to change the scheduled action to happen 0 hours after "now" - and if I change it to 0 hours after the Created Date for the Opportunity record it's not making a difference.

Any other ideas? Otherwise, thanks for trying!
Serena