Valid DEX-450 Dumps shared by ExamDiscuss.com for Helping Passing DEX-450 Exam! ExamDiscuss.com now offer the newest DEX-450 exam dumps, the ExamDiscuss.com DEX-450 exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com DEX-450 dumps with Test Engine here:
A developer must perform a complex SOQL query that joins two objects in a Lightning component. How can the Lightning component execute the query?
Correct Answer: C
When a Lightning component needs to execute a complex SOQL query that joins two objects, and such queries are not supported directly in Lightning components, the solution is to use an Apex controller method. Option C: Invoke an Apex class with the method annotated as @AuraEnabled to perform the query. Correct Approach. The Lightning component can call an Apex method annotated with @AuraEnabled. The Apex method can perform the complex SOQL query and return the results to the component. While it's possible to invoke flows from Lightning components, flows are not ideal for executing complex SOQL queries. Flows have limitations on data manipulation and querying. Option B: Write the query in a custom Lightning web component wrapper and invoke from the Lightning component. Not Applicable. Lightning components (Aura or LWC) cannot execute complex SOQL queries directly. They must call server-side Apex methods for such operations. Option D: Use the Salesforce Streaming API to perform the SOQL query. Incorrect. The Streaming API is used for subscribing to data changes in real-time. It is not used for executing queries. Conclusion: The Lightning component should invoke an Apex method annotated with @AuraEnabled to perform the complex SOQL query, which is Option C. Reference: Lightning Components and Apex Using Apex to Get Data Incorrect Options: Option A: Create a flow to execute the query and invoke from the Lightning component. Not Optimal.