English 中文(简体)
Salesforce: Trigger that fires off a Workflow rule has stopped working - any ideas?
原标题:

So in one part of our customised Salesforce system, the following happens:

  • a trigger changes the value of a picklist on a custom object
  • a Workflow rule detects that change and fires off an email.

Since about the 4th of December though, it seems to have stopped working. edit: The Debug Logs show that the trigger is firing and changing the value of the picklist, but no Worflow Rules are evaluated.

The workflow rule is pretty simple, so I don t really understand whats preventing it. The details of the rule are:

Operates on a custom object.
Evaluation Criteria: When a record is created, or when a record is edited and did not previously meet the rule criteria
Rule Criteria: ISPICKVAL(Status__c, Not Started )
Active: Yes
Immediate Workflow Actions: an email alert

Edit: The Rule does fire if I manually update the object to set the appropriate status. But it isn t firing when a trigger changes the status.

Edit: Did something change on Salesforce around December 4th 2009? That seems to be when this stopped working ...

Any ideas?

最佳回答

To answer my own question ... I eventually found out what this was.

The Salesforce Spring 09 Workflow Rule and Roll-Up Summary Field Evaluations update was rolled out to all orgs at the start of Dec 09, and changed certain Workflow behaviours.

The update improves the accuracy of your data and prevents the reevaluation of workflow rules in the event of a recursion.

Our particular problem was that we needed Workflow to be evaluated twice on a single object after the initial action - we had a series of changes to a status field that needed to kick off different things. After the Spring 09 update, Workflow is only evaulated once for an action on an object.

So, it did work, but then the platform changed, and it didn t work anymore. Time to write some code.

问题回答

If you had said "the trigger does not fire the workflow, even though a manual change via the UI does", I would have responded something like...

Absolutely. That s how it is designed. Salesforce do not allow anything automated to invoke anything automated (ie you cannot start a WF from a trigger or another WF).

Given that you say this stopped working earlier in the month, I am frankly astonished! We wanted to achieve something like this, would have been about 10 months ago, and Salesforce told us it could not be done; they like to keep tight control over processes that could potentially run away and consume large CPU (because of the multi-tenanted nature of the offering), hence the stringent governor limits...

This may have changed recently, of course, we built work-rounds to get round the restriction...





相关问题
Using Aggregate Functions Inside a Trigger In MySQL

I have a People table with several attributes including age . Each time I insert a new tuple into this table, I would like to find out the average age of all the people listed in the table. If the ...

Mysql trigger/events vs Cronjob

I have an auction website which let my users place an unlimited amount of autobiddings. To monitor these autobiddings something has to check the database every second. My question is if it is ...

creation of trigger

I have this trigger procedure CASE_A as UPDATE table1 SET field1 = (SELECT bus FROM view1 WHERE table1.document = view1.document) end; the below trigger is supposed to execute the above ...

Inserting trigger (SQL 2005)

I have a temp table (question_desc, ans1, ans2, ans3, ans4, correct_ans, marks) with say 10 entries. From this table I have to insert values in two other tables: questions (q_id(auto-generated), ...

Before trigger in SQL Server

I have 2 tables: survey (id(PK), name) and survey_to_topic (survey_id(PK,FK,not null), topic_id(PK,FK,not null)). When I try to delete from survey table, I get exception: "The DELETE statement ...

Jquery mouseover/mouseout triggering inconsistently

I have two sortable lists, one being nested, with a mouse over effect on the li elements of the nested sortable list. My problem is that the mouseover and mouseout functions are being called ...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签