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
Kristopher TurekKristopher Turek 

Change pricebook based on date value

We have a standard pricebook and contracts that the rate applies to... when the contract date has expired we would like to have the rates go up say 15%... i assume we need to create a second pricebook and have the higher rate pricebook become standard once the date has passed... how do we do this? Trigger? what would the code look like?
Hi Kris

You can make use of process builder, using process builder we can create new records and assing new values to the new record, in your case

1. Create a new process builder.
2. Create a decision box with criteria to 'created and edited to subsequently met the criteria', where the criteria is that the date is greater than the contract end date.
3. Add an immediate action to create a new record, where you can update the price book value to a formula value which gives the updated rate.

Hope it works :)