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
Saad Ahmad 33Saad Ahmad 33 

I'm trying to do a field update based on a campaign split calculation on the opportunity - how can I fix this?

Essentialy, I'm taking the amout on the opportunity and dividing it by the total number of days for the campaign. Total days is calculated by the campaign start date through the campaign end date. 

Once I get that calculation, I am allocating the split by month and want to populate it in the fields below on the opportunity by month (P1 = January, P2 = February, etc) 

For the example below, it's doing the field update for the P month fields, but I need help with the logic so the rev is distributed correctly for the months. 

For example for P4 - April it should show the value as $757 * 3 days (since that's how many days are part of the campaign in April) Thank you!

User-added image

User-added image

Any suggestions?