exam questions

Exam Certified Platform Developer II All Questions

View all questions & answers for the Certified Platform Developer II exam

Exam Certified Platform Developer II topic 1 question 50 discussion

Actual exam question from Salesforce's Certified Platform Developer II
Question #: 50
Topic #: 1
[All Certified Platform Developer II Questions]

A company has a custom object, Order__c, that has a required, unique, external ID field called Order_Number__c.
Which statement should be used to perform the DML necessary to insert new records and update existing records in a List of Order__c records?

  • A. upsert orders;
  • B. upsert orders Order_Number__c;
  • C. merge orders Order_Number__c;
  • D. merge orders;
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
MetaLojiqTee
10 months ago
Selected Answer: B
If you don't specify the external Id Order_Number__c as the matching field, many records may be inserted with the same Order_Number__c (but different Salesforce Ids), introducing duplicates
upvoted 2 times
...
santo_aj
1 year ago
Selected Answer: B
B is de correct answer. https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_dml_section.htm?q=upsert
upvoted 2 times
...
santo_aj
1 year, 1 month ago
Correct answer is B. This next example performs an upsert of a list of accounts using a foreign key for matching existing records, if any. List<Account> acctList = new List<Account>(); // Fill the accounts list with some accounts try { // Upsert using an external ID field upsert acctList myExtIDField__c; } catch (DmlException e) { ... }
upvoted 1 times
...
bungie
1 year, 1 month ago
Shouldn't the answer be A, do we need to specify the field?
upvoted 1 times
YNWA_A1
10 months, 1 week ago
if you dont specifiy the field, it will take the standard id fiel
upvoted 1 times
...
...
karappo
1 year, 3 months ago
https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_dml_section.htm?q=upsert
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...