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
kiran punurukiran punuru 

opportunity billing start date

Hi ,

Iam having one scenario  where i need to send reminder mails on friday in which the reminder mail contains all the opportunities satisfying this condition:
[select id,name from opportunity where billingstartdate < today];

on monday i need to update for all the opportunities i have sent on friday but here also we are using same condition to update:
[select id,name from opportunity where billingstartdate < today];

Because we are using the same condition it will update the opportunities having billing start date on friday ,sat,sun .But i  need to update for those opps which sended in reminder mail on friday.

If change in the same query will it work ,Any suggestion on this.

Thanks,
kiran 
 
Dayakar.DDayakar.D
Hi Kiran,
Please try this query it may help you.
[select id,name from opportunity where billingstartdate<:date.today().addDays(-1)];

Here -1 means it will go back to 1 day.
you can use your number to go back number of days.

Please let me Know if it solves your problem.
Best Regards,
Dayakar.D