Universal Containersは、既存の社内カスタムWebアプリケーションとの統合を必要としています。このWebアプリケーションは、JSONペイロードを受け取り、商品画像のサイズを変更し、サイズ変更後の画像をSalesforceに送信します。
この統合を実装するために開発者は何を使うべきでしょうか?
正解:A
Comprehensive and 19Detailed 150 to 250 words of Explanation:20
This integration requiremen21t involves two specific needs: sending a custom JSON payload and handling a response that involves updating data in Salesforce. Outbound Messaging (Option C) is a declarative tool, but it is limited to XML/SOAP protocols and cannot send JSON. Therefore, a custom programmatic solution using Apex is required to construct and send the JSON payload to the external REST service.
Since the integration must be triggered by an event in Salesforce (likely the upload or update of a product record), an Apex trigger is the most direct starting point. However, as noted in previous questions, callouts cannot be performed directly within a trigger's execution context because they would block the database transaction. The developer must use asynchronous processing to handle the callout. An @future(callout=true) method is the standard way to achieve this. The trigger captures the necessary data, passes it to the future method, and the future method then performs the HTTP request to the external application.
Once the external application resizes the image, it can use the Salesforce REST API to send the resized file back to Salesforce. While Platform Events (Option D) are a modern alternative for event-driven architectures, they would still require an asynchronous subscriber (like a trigger or a flow) to actually perform the callout, making the Trigger + Future method combination the most straightforward and traditional answer for this PDII scenario.