+ Start a Discussion
vishnu vardhan 142vishnu vardhan 142 

create 7 records by activating checkbox

Hi All

I have a scenario like 

If Active checkbox is checked on Class record then
Create 7 Child Future (Date >= today) coaching session records 
The Date range will determine the class date for Coaching Session record
The Date range will be generated from First Class Date field on the Class Record
For e.g. if an active Class record is created with a First Class Date of 1/9/2017
Then generate a date range with +7 days from this date
So the date range will be 1/9/2017 to 1/16/2017
Loop through this date range 
check if the date is in future
if yes then create a Coaching Session Record with class id pointing to the newly created or update class
RD@SFRD@SF
Hi Vishnu,

Yes, this can be achieved using the following two ways:
  1. Using process builder to build a process which would check if the dates are in future and created seven records where you can have 7 create records in the immediate actions, or if you have issues with the governor limits you can have a scheduled even on the process to create these records, to update the class id you can used the reference option in process builder to set the class id in these records.
  2. Or else if you some other related actions you can use the visual flows to create these records, where you have more options to query , create and update unrelated objects.
Hope it helps
RD