Salesforce Certified Integration Architect — Question 24
A company is designing a Lightning Web Component (LWC) to display transactions aggregated from different sources. Their current system landscape is as follows:
1. Transactions are created at any time through their various on-premise and cloud-based systems.
2. All necessary transactions are replicated to a custom Transaction object in Salesforce. It is updated periodically so it only has a subset of the necessary transactions between updates.
3. Middleware supports publish-subscribe interactions and provides RESTful Enterprise APIs that can retrieve transactions from on-premise and cloud-based systems.
The company wants to address a usability concern regarding incomplete data displayed on the LWC component.
What should the integration architect specify so the LWC will be able to display all the required transactions?
Answer options
- A. Publish a Platform Event, have the middleware subscribe and update the custom object on receipt of Platform Event.
- B. Call the Enterprise APIs directly from the LWC's JavaScript code and redisplay the LWC on receipt of the API response.
- C. Use the Continuation class to call the Enterprise APIs and then process the response in a callback method.
- D. Let the Lightning Data Service with an @wire adapter display new values when the custom object records change.
Correct answer: C
Explanation
The correct answer is C because using the Continuation class allows for asynchronous calls to the Enterprise APIs, which is ideal for handling potentially long-running requests without blocking the UI. Option A is incorrect because relying on Platform Events may not guarantee immediate updates to the custom object. Option B directly calls the APIs, which could lead to incomplete data if the LWC renders before all transactions are retrieved. Option D uses Lightning Data Service, but it won't pull all necessary transactions if the custom object is not fully updated.