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
mayank_friend52mayank_friend52 

Event Expires Trigger ?

Hello,

Can we write a trigger which will execute when an event expires?

Thanks,
Mayank Agarwal
Vinit_KumarVinit_Kumar
You will have to create the Trigger handlers to achieve the same.Go through the below links to learn more :-

http://www.tgerm.com/2012/01/salesforce-apex-trigger-template.html

http://gokubi.com/archives/two-interesting-ways-to-architect-apex-triggers

If this helps,please mark it as best answer to help other :)
mayank_friend52mayank_friend52
Hello,

Thanks Vinit.
Vinit_KumarVinit_Kumar
Go ahead and mark it as best answer to help others :)
mayank_friend52mayank_friend52
Hello,

Vinit, could you please tell me what are the conditions when an event expires in salesforce.

Thanks,
Mayank
Vinit_KumarVinit_Kumar
After events :)
mayank_friend52mayank_friend52
Hello Vinit.

Is there any mean by which we can update one field of Event when Event Expires and then we can fire trigger.?
What about workflow to achieve this?

Thanks,
Mayank 
Vinit_KumarVinit_Kumar
I don't unsderstand what u meant by 'we can update one field of Event when Event Expires'.

Are you talking about Event Due date if it is due to fire a trigger or something else ??

mayank_friend52mayank_friend52
Hello Vinit,

As per my knowledge, triggers are excuted when there is some event (insert, update, delete, undelete). So we can update one field of Event Object on Expiration of Event, then we will write a trigger which will solve my problem.

Is this possible, to update one Event Field through Workflow on Event Expiration and if possible then what is the Rule criteria for workflow to implement this?

Thanks,
Mayank 
Vinit_KumarVinit_Kumar
Here,is how I will approach it .

I will check whether current time is equal to Event's EndDateTime or not.If it is,then I will fire the WF field update and update that WF field.


mayank_friend52mayank_friend52
Hello Vinit,

I also tried  to use this approach but unable to fix this.
Could you please share the Rule Criteria for workflow for this, either in Formula or Criteria Form.


Thanks,

Mayank 
Vinit_KumarVinit_Kumar
Can you tell me what was the criteria you had for this.
mayank_friend52mayank_friend52
Hello Vinit,

Rule Criteria for the workflow:

Event: Endless or equalTODAY

But i want to use Event's EndDateTime in Formula to be true rather than the above Rule Criteria.


Thanks,
Mayank