niversal Containers (UC) は、Salesforce の注文をカスタムオブジェクト Crder_c で処理します。また、営業担当者が注文の CSV ファイルを一度にアップロードすることもできます。
開発者は、Salesforce での注文を UC のエンタープライズ リソース プランニング (ERP) システムと統合する任務を負っています。
Craer__c のステータスが最初に「発注済み」に設定された後、一度に注文を処理できる ERP システムの REST エンドポイントに注文情報を送信する必要があります。
これを達成するには開発者は何を実装する必要がありますか?
正解:D
The developer should implement a callout from a queueable class called from a trigger to accomplish this. A callout is a request that is sent from Salesforce to an external service, such as a REST endpoint in the ERP system1. A queueable class is an Apex class that implements the Queueable interface and can be executed asynchronously by adding it to the Apex job queue2. A trigger is an Apex script that executes before or after specific data manipulation language (DML) events on a Salesforce object, such as insert, update, or delete3.
The reason why this option is the best is because:
* A callout from a future method called from a trigger (option A) is not recommended, because future
* methods have some limitations, such as not being able to pass sObjects as parameters, not being able to chain future calls, and not being able to monitor the status of the execution4.
* A callout from a schedulable class called from a scheduled job (option B) is not suitable, because scheduled jobs run at a specified time or interval, and not in response to a data change event, such as setting the order status to "Placed"5.
* A flow with a callout from an invocable method (option C) is not feasible, because flows cannot be triggered by data changes, but only by user actions, such as clicking a button, or by process automation tools, such as Process Builder or Workflow.
References:
* 1: Callouts | Apex Developer Guide | Salesforce Developers
* 2: Queueable Apex | Apex Developer Guide | Salesforce Developers
* 3: Triggers | Apex Developer Guide | Salesforce Developers
* 4: Using the Future Annotation | Apex Developer Guide | Salesforce Developers
* 5: Schedulable Interface | Apex Developer Guide | Salesforce Developers
* : [Flow Trigger Workflow Actions | Salesforce Help]