Month End Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: simple70

Salesforce Certified Platform Developer II ( Plat-Dev-301 ) PDII Question # 1 Topic 1 Discussion

Salesforce Certified Platform Developer II ( Plat-Dev-301 ) PDII Question # 1 Topic 1 Discussion

PDII Exam Topic 1 Question 1 Discussion:
Question #: 1
Topic #: 1

MyOpportunities.js

JavaScript

import { LightningElement, api, wire } from 'lwc';

import getOpportunities from '@salesforce/apex/OpportunityController.findMyOpportunities';

export default class MyOpportunities extends LightningElement {

@api userId;

@wire(getOpportunities, {oppOwner: '$userId'})

opportunities;

}

OpportunityController.cls

Java

public with sharing class OpportunityController {

@AuraEnabled

public static List findMyOpportunities(Id oppOwner) {

return [

SELECT Id, Name, StageName, Amount

FROM Opportunity

WHERE OwnerId = :oppOwner

];

}

}

A developer is experiencing issues with a Lightning web component. The co12mponent must surface information about Opportunities owned by the currently logged-in user. When the component is rendered, the following message is displayed: "Error retrieving data". Which action must be completed in the Apex method to make it wireable?13


A.

Use the Continuation=true attribute in the Apex method.14


B.

Edit the code to use the without sharing keyword in the Apex class.15


C.

Use the Cacheable=true attribute in the Apex method.16


D.

Ensure the OWD for the Opportunity object is Public.17


Get Premium PDII Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.