Uniersal Containers (UC) は、すべての営業担当者が新規顧客を作成するたびに一連のスクリプト化された手順を実行することを要求する営業チーム向けのプロセスを開発しています。
情報収集の最初のステップでは、REST エンドポイントとして UC の ERP システムをチェックして、顧客が存在するかどうかを確認する必要があります。顧客が存在する場合は、データを Salesforce の営業担当者に提示する必要があります。
要件を満たすために開発者は次の 2 つを実装する必要がありますか?
2 つ答えを選んでください
正解:A,D
To satisfy the requirements, a developer should implement a flow and an invocable method. A flow is a declarative tool that allows you to automate business processes by collecting data and performing actions in your org or an external system1. An invocable method is a method that can be called by a flow, a process, or another Apex method2. By using a flow and an invocable method, the developer can achieve the following steps:
* Create a flow that guides the sales rep through the scripted steps with each new customer they create1.
* In the flow, use an Apex action to invoke an invocable method that calls the REST endpoint of UC's ERP system and passes the customer information as a parameter23.
* In the invocable method, use the HttpRequest and HttpResponse classes to send a GET request to the REST endpoint and receive a response that contains the customer data4.
* In the invocable method, parse the response body and return the customer data as an output parameter to the flow24.
* In the flow, use a screen element to display the customer data to the sales rep if the customer exists in the ERP system1.
Using a future method or a trigger are not effective ways to satisfy the requirements. A future method is a method that runs in the background, asynchronously, after the current transaction finishes5. A trigger is a piece of Apex code that executes before or after a record is inserted, updated, deleted, or undeleted. Neither of these options can interact with the flow or the sales rep, and they are not suitable for calling a REST endpoint that requires a synchronous response5 . References: 1 Automate Your Business Processes with Flows | Salesforce Trailhead1, 2 InvocableMethod Annotation | Apex Developer Guide | Salesforce Developers2, 3 Call Apex Code from a Flow | Salesforce Trailhead3, 4 Apex REST Callouts | Apex Developer Guide | Salesforce Developers4, 5 Asynchronous Apex | Apex Developer Guide | Salesforce Developers5, Triggers | Apex Developer Guide | Salesforce Developers