PDII試験無料問題集「Salesforce Platform Developer II 認定」
Consider the Apex controller below, that is called from an Aura component:
Line 5 @AuraEnabled
Line 6 public List<String> getStringArray() {
Line 7 String[] arrayltems = new String[]{ 'red', 'green', 'blue' };
Line 8 return arrayltems;
Line 9 }
Line 10}
What is wrong with this code?
Line 5 @AuraEnabled
Line 6 public List<String> getStringArray() {
Line 7 String[] arrayltems = new String[]{ 'red', 'green', 'blue' };
Line 8 return arrayltems;
Line 9 }
Line 10}
What is wrong with this code?
正解:A
解答を投票する
解説: (GoShiken メンバーにのみ表示されます)
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<Opportunity> 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
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<Opportunity> 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
正解:C
解答を投票する
解説: (GoShiken メンバーにのみ表示されます)
A developer implemented a custom data table in a Lightning web component with filter functionality.
However, users are submitting support tickets about long load times when the filters are changed. The component uses an Apex method that is called to query for records based on the selected filters. What should the developer do to improve performance of the component?
However, users are submitting support tickets about long load times when the filters are changed. The component uses an Apex method that is called to query for records based on the selected filters. What should the developer do to improve performance of the component?
正解:D
解答を投票する
解説: (GoShiken メンバーにのみ表示されます)