Workflow Rule
- Update a field
- Send an email
- Create a Task
- Send an outbound message (communication with another system)
- Using workflow we can update child to parent fields.
- We can’t perform DML or SOQL with Workflow Rules.
Process builder
- Create a record (not just Tasks!)
- Update related records
- Launch a Quick Action
- Email Alert
- Post to Chatter
- Launch a Flow
- Call Apex code
- Submit for approval
- Invoke another process
- But the process builder doesn’t support outbound messages
- With process builder we can perform both,child to parent and parent to child field update.
- The annotation “@InvocableMethod” defines this method can be invoked from process builder like this:
global class lookUpAccountAnnotation {
@InvocableMethod
public static List<String> getAccountIds(List<String> names) {
List<Id> accountIds = new List<Id>();
List<Account> accounts = [SELECT Id FROM Account WHERE Name in :names];
for (Account account : accounts) {
accountIds.add(account.Id);
}
return accountIds;
}
}
If i have missed something or anything i have mentioned is wrong then please tell me in comments.
Leave a comment