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
SATZSATZ 

Is it possible to call a trigger using workflow rule?

Hi all,

 

I created a education Custom object, In that object having two fields name  Phase 3 and Phase 3 Subsciption end date fields.

 

1) Using the trigger autopopulate the phase 3 field from Education object to Education tracker custom object.

The condition is :  Phase 3 Subsciption end date >= Today.     \\This is working fine

 

2) Once  Phase 3 Subsciption end date <= TODAY  we need to remove the phase 3 field value in Education tracker object

I written a logic in trigger.       But how to system invoke the this trigger logic automatically based on this condition   Phase 3 Subsciption end date <= TODAY

 

I think Using workflow is this possible to invoke the trigger automatically

 

Your valueable suggestions are welcome

Thanks 

TheIntegratorTheIntegrator

Please take a look at order of execution in Salesforce

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm

 

Triggers are executed before workflows.

 

What you are trying to acheive can be done using a time trigger workflow, when 

Phase 3 Subsciption end date <= TODAY

You set some dummy field in Education object, update of which could be caught in a trigger and here you can write the logic to remove phare3 field value from Education tracker object

 

Let me know if that solves it.

SATZSATZ

Hi,

 

I created One pick list field in Education Object  called Status.

Im using the following condition in my workflow rule as following

 

Evaluation Criteria :When a record is created, or when a record is edited and did not previously meet the rule criteria

Rule Criteria : Education: Phase 3 Subscription End Date equalsTODAY.

Time-Dependent Workflow Actions : 1 Hour After Rule Trigger Date

Field Update = Status Update.

 

i Create the Education records then auto matically Educatin Tracker record Created phase3  also populated. current Phase 3 Subsciption end date  i choose 7/4/12 . 

 

once 7/4/12 <= Today happend  we need to invoke the trigger remove the value in EducationTracker object.

 

Thanks


 



TheIntegratorTheIntegrator

Instead of putting this workflow condition, you can have the condition to enter this workflow when Phase 3 Subscription End Date is entered, at this event, have a time trigger action set to update status field on Phase 3 Subscription End Date

SATZSATZ

Hi, TheIntegrator

 

i can't understand workflow what you said please explain briefly...

 

i think i created workflow is wrong?

 

Thanks

TheIntegratorTheIntegrator

Its no incorrect, it just assumes that the record would be updated on the Phase 3 Subscription End Date, which in my opinion is a slim chance. Instead of doing that, change the rule criteria to NOT( ISBLANK( Phase_3_Subscription_End_Date__c)), then add a time trigger rule 0 Days After Phase_3_Subscription_End_Date__c, then add action to updates Status.

 

What this would do is, when this record is edited and inserted with Phase 3 Subscription End Date, Salesforce will create a time trigger to execute on this end date to update the status. When status updates, you can catch that in the trigger and update whatever you need to update.

SATZSATZ

Thanks,

    TheIntegrator for your post 

 

 if this works i will let you to Know...............

 

 

Thanks

SATZ

 

SATZSATZ

Hi,

 

i create the workflow  criteria what you send.

 

i create the Education Record.Phase 3 Subscription End Date = 7/4/2012. but still not remove the value from completed field in EducaitonTracker object. 

 

Evaluation Criteria :When a record is created, or when a record is edited and did not previously meet the rule criteria

Rule Criteria : NOT( ISBLANK( Phase_3_Subscription_End_Date__c)).

Time-Dependent Workflow Actions : 0 Days After Education: Phase 3 Subscription End Date

Field Update = Status Update.

 

give me your ideas..............

 

Thanks

TheIntegratorTheIntegrator

the workflow was just to update a field on Education object, based on this update you have to write a trigger to update educationtracker object with whatever it is you are trying to accomplish.

 

 When status updates, you can catch that in the trigger and update whatever you need to update."