nerdexam
Salesforce

PDII · Question #364

Consider the following code snippet: Which two steps should the developer take to add flexibility to change the endpoint and credentials without needing to modify code? (Choose two.)

The correct answer is C. Use req.setEndpoint('callout:endPoint_NC'); within the callout request. D. Create a Named Credential, endPoint_NC, to store the endpoint and credentials. See the full explanation below for the reasoning.

Question

Consider the following code snippet:

Which two steps should the developer take to add flexibility to change the endpoint and credentials without needing to modify code? (Choose two.)

Exhibit

PDII question #364 exhibit

Options

  • AUse req.setEndpoint(Label.endPointURL);.
  • BStore the URL of the endpoint in a custom Label named endPointURL.
  • CUse req.setEndpoint('callout:endPoint_NC'); within the callout request.
  • DCreate a Named Credential, endPoint_NC, to store the endpoint and credentials.

How the community answered

(44 responses)
  • A
    7% (3)
  • B
    11% (5)
  • C
    82% (36)

Community Discussion

No community discussion yet for this question.

Full PDII Practice