- Learning Salesforce Visual Workflow and Process Builder(Second Edition)
- Rakesh Gupta
- 146字
- 2021-07-09 20:57:32
Solution 1 - using an Apex trigger
Because this requirement means that many child records (opportunities) need to be updated when a parent record (Account) is edited, we can't achieve the preceding business requirement using the Workflow rule. The next possibility is to use an Apex trigger. Generally, a developer writes an Apex trigger on the Account object to update all the open opportunities when an account's custom field, out of business, gets updated to True. The following is the sample code:
trigger UpdateRelatedOpportunites on Account (after update) {
for (Account AccountToUpdate : trigger.new)
{
If (AccountToUpdate.Out_Of_Business__c==True)
{
// Your logic;
}
}
}
In addition, you'll need a test class and then use a change set, Force.com IDE or Force.com Migration Tool, to deploy the trigger and test classes to production. This also means that any change to the business logic will require more development work.
推薦閱讀
- 新中國審計制度變遷
- 資本的眼睛
- Magento 2 Cookbook
- 國有企業經濟責任審計實務指南
- 金融保險集團內部審計創新與實踐
- Big Data Visualization
- 審計基礎
- 中國政府統計問題研究
- Tableau:Creating Interactive Data Visualizations
- 2017年度注冊會計師全國統一考試專用教材(圖解版):審計
- Big Data Analytics with R and Hadoop
- Oracle Primavera Contract Management,Business Intelligence Publisher Edition v14
- 傳習集2
- Microsoft Dynamics CRM 2016 Customization(Second Edition)
- 審計實務