exam questions

Exam PL-400 All Questions

View all questions & answers for the PL-400 exam

Exam PL-400 topic 5 question 28 discussion

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

HOTSPOT -
A JavaScript function on a Contact form alerts users to what they need to type, as shown in the JavaScript Code exhibit. (Click the JavaScript Code tab.)

The Business Phone field has the OnChange event handler defined as shown in the Event Handler exhibit. (Click the Event Handler tab.)

Users report that there is incorrect wording on the Contact page, as shown in the Contact exhibit. (Click the Contact tab.)

You need to determine what happens when a user modifies the business phone of a contact record.
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 -
setNotification displays an error message for the control to indicate that data isn't valid. When this method is used, a red "X" icon appears next to the control. On
Dynamics 365 mobile clients, tapping on the icon will display the message.
Syntax: formContext.getControl(arg).setNotification(message,uniqueId);

Box 2: No -

Box 3: Yes -
setFormNotification displays form level notifications. You can display any number of notifications and they will be displayed until they are removed using clearFormNotification.
Syntax: formContext.ui.setFormNotification(message, level, uniqueId);

Box 4: No -
Reference:
https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/formcontext-ui/setformnotification https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/controls/setnotification

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
KAL18
Highly Voted 2 years, 6 months ago
<<< For second one >>> formContext.getControl(where).setNotification(sMessage, msgId); should be as follows at run-time. formContext.getControl("telephone1").setNotification("mobilephone", "telephone1id"); So the answer should be: NYNY
upvoted 15 times
...
fayeje1956
Highly Voted 2 years, 2 months ago
I had this question on my exam and there is a typo in the dump. The actual line of code is: var msgid = where + "id"; So a + instead of =. Therefore my selected answers were: N - the message on Business Phone will be "mobilephone" (assuming Business Phone's logical name is "telephone1") Y - same explanation as for answer 1 N - the form notification will be 'mobilephone' and the id of the message 'telephone1id' Y - same explanation as for answer 3
upvoted 15 times
...
Juan0414
Most Recent 2 months, 2 weeks ago
"telephone1" is captured by "where" and "mobilephone" is captured by "sMessage". So the "mobilephone" message is the one that is displayed. No Yes No Yes
upvoted 1 times
...
SachinBisht009
8 months, 2 weeks ago
No Yes No Yes is Right ans
upvoted 1 times
...
oleav
1 year, 1 month ago
agree with NYNY
upvoted 1 times
...
jojolaf
2 years, 2 months ago
This JS code is not even syntaxicaly correct least in 3 different locations. Who write this code ? Is this writed down from a candidate ? Is this a dump of an actual exam ? I Would like to know.
upvoted 1 times
fayeje1956
2 years, 2 months ago
I had it a couple of days ago and it's correctly formatted on the exam. In the first line you have == undefined, then the arguments are (exContext, where, sMessage), getFormContext has also () at the end instead of [] and it's where + "id" and not where = "id".
upvoted 3 times
...
...
RichardMa
2 years, 4 months ago
NNNY var msgID=where="id"; so the value of Where is "id" tested at trial env
upvoted 4 times
shavarse
2 years, 3 months ago
In this case they should all be No, as we go into the catch block before executing formContext.ui.setFormNotification(sMessage, "INFO", msgId); and only display the alert. I tried it as well and only got the alert.
upvoted 3 times
...
...
ZZZDD
2 years, 5 months ago
What about part in the code var msgID = where = "id"; would not than where become just "id", so nothing would be set in there ?
upvoted 3 times
...
piboke
2 years, 5 months ago
technically formContext.getFormContext[] will be null/undefined. It should be formContext.getFormContext(), but I assume that's a typo. If so, the correct answer was provided by D_D
upvoted 1 times
...
Hendrikdb
2 years, 6 months ago
Correct answer is NNNY. formcontext.getcontrol("telephone1).setnotification("mobilephone") and formcontext.ui.setformnotificaiton("mobilephone","info", "id")
upvoted 2 times
...
lesiris
2 years, 7 months ago
There is no field mobile phone, just a field Business phone ... How is it supposed to work ?
upvoted 2 times
...
D_D
2 years, 11 months ago
Yes, the code is really a mess. But in my eyes here we have the "showMessageOnField" function which actually receive 3 parameters: first is executionContext and the other two are the two defined in the "Comma separated list of parameters...". In this case the function definition has three parameters (exContext, where, sMessage"). In runtime it will receives in sequence: executionContext, "telephone1" (as string), "mobilephone"(as string). So actually the code will write the 3d parameter("telephone1") on the control with name "where" (businessphone"). This is in my eyes the only explanation which makes sense and in this case the answers are all corrects.
upvoted 5 times
D_D
2 years, 11 months ago
I correct myself: 1st parameter = exContext 2nd parameter (where) = "telephone1" 3th parameter (sMessage) = "mobilephone" formContext.getControl(where).setNotification(sMessage, msgId) => formContext.getControl("telephone1").setNotification("mobilephone", <msgId>) => message "mobilephone" is written in notification area of field telephone1. formContext.ui.setFormNotification(sMessage, "INFO", <msgId>) => formContext.ui.setFormNotification("mobilephone", "INFO", <msgId>) => message "mobilephone" is written in notification area of the form The correct answers are NYNY
upvoted 35 times
...
...
Leila24
2 years, 11 months ago
The JS code in the screenshot is a mess. If I red that correctly the "mobilephone" message shall be displayed instead "telephone1"
upvoted 10 times
rijifa7178
2 years, 11 months ago
Same bro ;(
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