exam questions

Exam PL-400 All Questions

View all questions & answers for the PL-400 exam

Exam PL-400 topic 7 question 1 discussion

Actual exam question from Microsoft's PL-400
Question #: 1
Topic #: 7
[All PL-400 Questions]

HOTSPOT -
A company updates their client contact information periodically. The contact entity has alternate keys defined.
You have the following code. (Line numbers are included for reference only.)

For each of the following statements, select Yes if the statement is true. Otherwise, select No.
NOTE: Each correct selection is worth one point.
Hot Area:

Show Suggested Answer Hide Answer
Suggested Answer:
Reference:
https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/use-alternate-key-create-record

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
cleon37
Highly Voted 4 years, 4 months ago
No scenario can be yes, because the value of the lastname field is overwritten with the value of "Doe". All duplicate evaluation with the combination of alternate keys is done with the latter value.
upvoted 48 times
loftuscheek
2 months, 2 weeks ago
correct no no no no , The UpsertRequest only updates a record if both alternate keys match an existing record. If no matching record exists, a new record is created with the explicitly assigned values (lastname = "Doe"). None of the statements are correct because they assume "lastname" or "clientnumber" alone can determine whether a record exists or what value it will store.
upvoted 1 times
...
smusau
4 years, 3 months ago
True, Should be No for all.
upvoted 8 times
...
Anks123
4 years, 1 month ago
3rd answer should be Yes. the system will throw error if multiple smiths are found and thus no change will happen in last name. So stored value will be smith
upvoted 6 times
Puneet1891
4 years ago
all the answers should be No. alternate key can not be duplicated. they are getting the record by a combination of 2 attributes, so even if there are people with smith but there would be max 1 record the combination of last name and client number.
upvoted 6 times
Doppelfinger
3 years, 11 months ago
yes, completely agree. KeyAttribute is only for matching. Does not participate in update. 2nd would be corect if it was ... last name is Doe..
upvoted 1 times
...
majklik
3 years, 11 months ago
Nothing changed, same value stay in Dataverse. Its Smith, actually. 3rd answer is Yes.
upvoted 1 times
chiari_do
2 years ago
Also for me: NNYN
upvoted 2 times
...
...
...
...
...
ConradMoulin
Highly Voted 4 years, 4 months ago
The code is wrong in many ways. Working code : Entity contact = new Entity() { LogicalName = "contact", KeyAttributes = { {"lastname", "Smith" }, {"clientnumber", "abc123" } } }; contact["lastname"] = "Doe"; UpsertRequest updcontact = new UpsertRequest() { Target = contact }; UpsertResponse response = (UpsertResponse)crmService.Execute(updcontact);
upvoted 5 times
ZVV
4 years ago
And the answer?
upvoted 2 times
...
...
Juan0414
Most Recent 2 months, 1 week ago
Syntax is wrong in multiple places, but even if we assume that it is correct. Answers are still No for all. Last name is being changed to "Doe" before the Upsert
upvoted 1 times
...
RavinBrissy
3 months, 2 weeks ago
Don't understand the purpose of such questions. Technically all are No.
upvoted 1 times
...
VKS5
6 months, 1 week ago
No for all
upvoted 1 times
...
RyanShresta
1 year, 11 months ago
For me its NNYN
upvoted 1 times
...
justin_s
2 years, 4 months ago
So NO ONE just TEST it???? There will be an error if you use none-key-attribute in KeyAttribute only when xxx (try it plz). It is not the behavior said in MS doc, very disappointment.
upvoted 1 times
...
BeginLearningforPP
2 years, 7 months ago
Should be NO for all
upvoted 1 times
...
PulkitG
2 years, 8 months ago
when created - Attribute is priority when updated - Key is priority No - Create - attribute is priority, so Deo Yes - Update - Key is priority - Smith Yes - Update - Key is priority - Smith No - Create - attribute is priority, so Deo
upvoted 5 times
...
xanr4711
2 years, 8 months ago
1) NO: Record does not exist -> CREATE -> attributes have prio - last name will be doe 2) YES: Record does exist -> UPDATE -> key-attributes have prio - last name will be Smith 3) Undecided: For this to be possible at all, client number must be an alternate key too! So it clearly depends on wether the combination already existed (YES) or not (NO) 4) NO: Record does not exist -> CREATE -> attributes have prio - last name will be doe
upvoted 3 times
...
gobji
3 years, 6 months ago
No scenario can be yes
upvoted 2 times
...
Hendrikdb
3 years, 6 months ago
Correct answer: No: attributecollection has prio over keyattributes, so the created contact would have doe Yes: No change to the exisitng contact, so same as before Yes: one or multiple contacts found, doesn't matter, stored value stays the same No: Same as first question, a newly created contact would be named Doe
upvoted 3 times
kdevaa
3 years, 6 months ago
For the second, it says the key is client number and the matching data exists, then the last name will be updated as Doe correct?
upvoted 1 times
...
...
luvasgloves
3 years, 7 months ago
I would go with all No's because the lastname is overwritten to "Doe"
upvoted 5 times
...
prikrylm
3 years, 9 months ago
Whole code pobably crash on line 10 with "There is no key in the dictionary:...
upvoted 1 times
...
ZVV
3 years, 11 months ago
>> If you specify a column set that is not defined as a unique key, an error will be thrown indicating that use of unique key columns is required. So AK must consist of two columns for this code to work, doesn't it?
upvoted 1 times
...
val_maly
4 years ago
Should the answer be YES, NO, NO, YES? The reason https://docs.microsoft.com/en-us/powerapps/developer/data-platform/use-upsert-insert-update-record Understanding the Upsert process: 1. Send UpsertRequest with enough data for a create or insert operation. 2. Dataverse will look up the record targeted by the target table. 3. If the record exists: a. Set the ID property of the target table with the ID of the found record. b. Call Update. c. Set the RecordCreated to false. ... 4. If the record doesn’t exist: a. Copy any alternate key values into the target table columns. b. Call Create. c. Set the RecordCreated to true. ... Finally in the scenarios where we do CREATE record - the lastname WILL BE "Smith" And where we do UPDATE record - lastname will be "Doe"
upvoted 4 times
xanr4711
2 years, 8 months ago
Well just the other way round
upvoted 2 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago