exam questions

Exam PL-400 All Questions

View all questions & answers for the PL-400 exam

Exam PL-400 topic 5 question 27 discussion

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

HOTSPOT -
A model-driven app has the following JavaScript code. The code is attached to the OnChange event of the Phone (telephone1) field on the Account entity.

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:
Box 1: Yes -
Xrm.WebApi.updateRecord updates a table record.
Syntax:
Xrm.WebApi.updateRecord(entityLogicalName, id, data).then(successCallback, errorCallback);

Box 2: Yes -

Box 3: No -
No action would be taken.
Reference:
https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-webapi/updaterecord

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
Iker
Highly Voted 3 years, 5 months ago
1) YES. 2) NO. When the primarycontactid field is not populated, the script finished with an error. This occurs because the value of "var telephone = formContext.getAttribute("telephone1")" is equals to Null. 3) NO. When we removes the value of "telephone1" field, "if(!telephone)" condition becames true.
upvoted 54 times
Violoncello
2 years, 4 months ago
2: This is YES. I spent hours troubleshooting and verifying exact behavior. "telephone1" is a lookup. formContext.getAttribute("telephone1") is never null. However, the .getValue() returns null if there's no phone number.
upvoted 1 times
No_Doubt
2 years ago
2 is no, since a JS error will be thrown before entering the call of the API
upvoted 1 times
...
...
franekfranek
3 years, 4 months ago
2. I think then(onSuccess, onFailure) so on failure the massage alert is displayed ???
upvoted 5 times
rhess
2 years, 10 months ago
#2 is null because the code will fail looking for index 0 on a null value.
upvoted 4 times
...
...
MarkusH87
3 years, 2 months ago
I think its, Y N N too. As there would be a null execption before entering the callback logic of the update method.
upvoted 6 times
...
Violoncello
2 years, 4 months ago
On 2nd thought, the question is about contact, not telephone. The contact is null. So contact[0].id causes exception.
upvoted 3 times
...
...
twin
Highly Voted 3 years, 5 months ago
I have tried: Yes, No, No
upvoted 16 times
...
Juan0414
Most Recent 2 months, 2 weeks ago
1. Yes (Follow the script logic) 2. No (If primarycontactid is null then contact[0].id will fail, so the "updateRecord" is not executed, neither its errorCallback) 3. No (If telephone1 is null, then the script stops with return)
upvoted 1 times
...
Says
10 months, 1 week ago
Yes,No,No
upvoted 1 times
...
At09
1 year, 1 month ago
YNN 👍
upvoted 1 times
...
At09
1 year, 1 month ago
👍 .
upvoted 1 times
...
At09
1 year, 1 month ago
&#128077 .
upvoted 1 times
...
At09
1 year, 1 month ago
YNN .
upvoted 1 times
...
oleav
1 year, 7 months ago
YNN seems to be ok
upvoted 1 times
...
northstar88
2 years, 2 months ago
Should be YNN
upvoted 2 times
...
Kalimho
2 years, 3 months ago
in exam 2022.07.21
upvoted 1 times
...
CinthiaN
2 years, 9 months ago
IMO - Yes, No, No
upvoted 2 times
...
Stvi
3 years, 1 month ago
Y N - The code will throw an error when accessing the contact[0].id when it is null N
upvoted 5 times
...
ajithnair
3 years, 2 months ago
It should be - No, YES, NO Event happens on the change of Telephone and not on primarycontactid.
upvoted 1 times
ajithnair
3 years, 2 months ago
IGNORE THIS. The answers are correct. The first line says 'when the code runs'.
upvoted 3 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