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
Mike_M_2Mike_M_2 

UPDATE vs Edited

Workflows fire when a record is "Edited". Does the workflow fire if some APEX code does an UPDATE on the record. I'm guessing not, but I can't find any documentation to support this theory.

TIA

Mike

Best Answer chosen by Admin (Salesforce Developers) 
Andrew WilkinsonAndrew Wilkinson

And from the documentation here is when a workflow is and is not triggered.

 

When Do Workflow Rules Get Triggered?

  • Workflow rules can be triggered any time a record is saved or created, depending on your rule criteria. However, rules created after saving records aren't triggered by those records retroactively.
  • Workflow rules are triggered when a standard object in a master-detail relationship is re-parented, even if the object's evaluation criteria is set to Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria.
  • Saving or creating records can trigger more than one rule.
  • Workflow rules only trigger on converted leads if validation and triggers for lead convert are enabled in your organization.
  • Workflow rules trigger automatically and are invisible to the user. Alternatively, approval processes allow users to submit records for approval.
  • Workflow rules and entry criteria for approval processes and steps respect the user's locale and aren't triggered when the user is in a different language than that of the organization.
  • If you use record types in your workflow rule criteria whose labels have been translated using the translation workbench, the translated label value won’t trigger the workflow rule. Workflow criteria evaluate the master label value and ignore the translated value. To avoid this problem, set the workflow criteria to evaluate the master record type label value by entering it manually in the Value field.
  • Workflow rules can't be triggered by campaign statistic fields, including individual campaign statistics and campaign hierarchy statistics. For a list of campaign fields that cannot trigger workflow rules, see Campaign Fields.
  • The following actions don't trigger workflow rules:
    • Mass replacing picklist values
    • Mass updating address fields
    • Mass updating divisions
    • Changing the territory assignments of accounts and opportunities
    • Converting leads to person accounts

Saving a record whether in the UI or via APEX will cause the Edited rules to fire.

All Answers

Andrew WilkinsonAndrew Wilkinson

Yes the workflow rules will fire. Here is the documentation for the order of execution in regards to triggers for more informaton about triggers and workflow rules.

 

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

Andrew WilkinsonAndrew Wilkinson

And from the documentation here is when a workflow is and is not triggered.

 

When Do Workflow Rules Get Triggered?

  • Workflow rules can be triggered any time a record is saved or created, depending on your rule criteria. However, rules created after saving records aren't triggered by those records retroactively.
  • Workflow rules are triggered when a standard object in a master-detail relationship is re-parented, even if the object's evaluation criteria is set to Evaluate the rule when a record is: created, and any time it’s edited to subsequently meet criteria.
  • Saving or creating records can trigger more than one rule.
  • Workflow rules only trigger on converted leads if validation and triggers for lead convert are enabled in your organization.
  • Workflow rules trigger automatically and are invisible to the user. Alternatively, approval processes allow users to submit records for approval.
  • Workflow rules and entry criteria for approval processes and steps respect the user's locale and aren't triggered when the user is in a different language than that of the organization.
  • If you use record types in your workflow rule criteria whose labels have been translated using the translation workbench, the translated label value won’t trigger the workflow rule. Workflow criteria evaluate the master label value and ignore the translated value. To avoid this problem, set the workflow criteria to evaluate the master record type label value by entering it manually in the Value field.
  • Workflow rules can't be triggered by campaign statistic fields, including individual campaign statistics and campaign hierarchy statistics. For a list of campaign fields that cannot trigger workflow rules, see Campaign Fields.
  • The following actions don't trigger workflow rules:
    • Mass replacing picklist values
    • Mass updating address fields
    • Mass updating divisions
    • Changing the territory assignments of accounts and opportunities
    • Converting leads to person accounts

Saving a record whether in the UI or via APEX will cause the Edited rules to fire.

This was selected as the best answer