exam questions

Exam MB-400 All Questions

View all questions & answers for the MB-400 exam

Exam MB-400 topic 3 question 1 discussion

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

A multinational company requires that all phone numbers be standardized as country code + area code + phone number.
The application design team decides that a custom PowerApps component framework (PCF) control should be used to prompt users for an area code and correctly format the phone number.
You need to get the list of valid area codes when a contact record is opened and before the user enters a new phone number.
In which function should you call webAPI.retrieveMultipleRecords?

  • A. updateView
  • B. getOutputs
  • C. init
  • D. notifyOutputChanged
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
The updateView method will be called when any value in the property bag has changed. This includes field values, data-sets, global values such as container height and width, offline status, component metadata values such as label, visible, etc.
Set the value of the field component to the raw value from the configured field.
Note: webAPI.retrieveMultipleRecords retrieves a collection of entity records.
Incorrect Answers:
B: getOutputs is called by the framework prior to a component receiving the new data. Returns an object based on nomenclature defined in manifest, expecting objects[s] for the property marked as bound or output.
Reference:
https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/control/updateview

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
RobinS
Highly Voted 4 years, 10 months ago
init is used to initialize the component instance. Components can kick off remote server calls and other initialization actions. Data-set values cannot be initialized here, use the updateView method to achieve that. Therefore, you cannot use init.
upvoted 14 times
sanharshu7
4 years, 9 months ago
Agree, UpdateView is correct
upvoted 4 times
...
...
val_maly
Most Recent 4 years ago
I will wote for C: init The reason: Component should allow you to select country code and then format phone number accordingly. Looks like your component will contain two pieces: - dropdown with country codes - textbox (input) to enter phone number Inside init you do construct the html for those 2 pieces and there you can call webAPI.RetrieveMultiple to obtain all country codes from "CountryCode" custom entity and add them as options to dropdown. This will solve the requirements "You need to get the list of valid area codes when a contact record is opened and BEFORE the user enters a new phone number"
upvoted 1 times
...
wwaki
4 years, 4 months ago
It is INIT couse: You need to get the list of valid area codes when a contact record is opened and before the user enters a new phone number. So we have to retrieve it before any change run updateView
upvoted 2 times
...
jkaur
4 years, 4 months ago
Correct A
upvoted 1 times
...
ClairFraser
4 years, 10 months ago
I say Init. Data-set provides properties and methods to work with data on grids and views. WIth a single field, this is not the case. Notice that updateView is not called for field null values: Always use a required field that is guaranteed to have a value. If your field does not have a value, your embedded canvas app will not refresh in response to any change in data on the host model-driven form.
upvoted 3 times
Horrid
4 years, 7 months ago
init is for initializing the data and components. As per the framework event pipeline, updateView is invoked after init. So, I would do a webApi call in updateView. Look at this webApi component - https://docs.microsoft.com/en-us/powerapps/developer/component-framework/sample-controls/webapi-control all webapi calls are in updateView method.
upvoted 2 times
killuah0190
4 years, 7 months ago
I think ClairFraser is right, documentation says init is used for remote server calls. Actually querying web api is a remote server call. Furthermore area codes sound like static data, therefore it is enough to query them once, instead of query them everytime updateView is called. Also the dataset value initialization is no limitation here, because the component is bound to a field not a subgrid.
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago