Exams > Microsoft > PL-400: Microsoft Power Platform Developer
PL-400: Microsoft Power Platform Developer
Page 9 out of 23 pages Questions 81-90 out of 229 questions
Question#81

You are a Dynamics 365 developer working on a model-driven app.
You add a button to an entity form and to the view for the entity that calls a JavaScript function. When you click the button, it results in an error.
You determine that the JavaScript function is calling another JavaScript function in a different web resource.
You need to resolve the error.
What should you do?

  • A. In the JavaScript web resource, add the missing web resource as a dependency.
  • B. Add &ribbondebug=true to the app URL and run the Command Checker tool.
  • C. From the Ribbon Workbench, add the missing JavaScript web resource as a CustomRule in EnableRules.
Discover Answer Hide Answer

Answer: A
Web resource dependencies -
You can define dependencies between other web resources. The primary purpose of this feature is to allow association of String (RESX) web resources with the
JavaScript web resources that will use them. This is also the way that web resources required by HTML web resources for use offline can be configured to also be available offline.
Within a solution you can define dependencies within solution components. Up until Mode-driven Apps the main purpose of these dependencies was to prevent the deletion of a solution component when another solution component depended on it. With Model-driven apps the behavior for JavaScript web resources is enhanced so that any other web resource listed as a dependency to the JavaScript web resource will be loaded along with the JavaScript web resource.
Incorrect:
Not B: &ribbondebug=true is used for debugging.
Not C: When configuring ribbon elements, you can define specific rules to control when the ribbon elements are enabled.
Custom Rule uses the <CustomRule> element. Use this kind of rule to call a function in a Script (JScript) web resource that returns a Promise (Unified Interface) or boolean (Unified Interface and web client).
Reference:
https://docs.microsoft.com/en-us/power-apps/developer/model-driven-apps/web-resource-dependencies https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/define-ribbon-enable-rules

Question#82

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 Power Apps component framework (PCF) control should be used to prompt users for an area code and to 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. notifyOutputChanged
  • C. getOutputs
Discover Answer Hide Answer

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.
Note: webAPI.retrieveMultipleRecords retrieves a collection of entity records.
Incorrect Answers:
notifyOutputChanged is a callback method to alert the framework that the control has new outputs ready to be retrieved asynchronously. 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.
Reference:
https://docs.microsoft.com/en-us/powerapps/developer/component-framework/reference/control/updateview https://www.inogic.com/blog/2021/01/what-is-popupservice-in-powerapps-component-framework/

Question#83

HOTSPOT -
You are examining code written by another developer that is not functioning correctly. There are no other JavaScript or business rules in use on the form.
This code is properly registered to the OnChange event of the telephone1 field on an account entity form. The main operation is to update the primary contact's phone number when the account phone number changes. The primary contact field is a lookup. (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:

Discover Answer Hide Answer

Answer:
Box 1: Yes -
getFormTyp gets the form type for the record.
Form type 2 is Update.
Note: Syntax: formContext.ui.getFormType();

Return Value -

Type: Number -
Description: Form type. Returns one of the following values

RETURN VALUE -

Value Form type -
0 Undefined
1 Create
2 Update
3 Read Only
4 Disabled
6 Bulk Edit

Box 2: Yes -
Xrm.WebApi.updateRecord Return Value: On success, returns a promise object containing the values specified earlier in the description of the successCallback parameter.
Note:
Syntax: Xrm.WebApi.updateRecord(entityLogicalName, id, data).then(successCallback, errorCallback);
Where errorCallback: A function to call when the operation fails. An object with the following properties will be passed: errorCode: Number. The error code. message: String. An error message describing the issue.

Box 3: No -
It will displayed even if the update fails.
Reference:
https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/formcontext-ui/getformtype https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-webapi/updaterecord

Question#84

HOTSPOT -
You have the following JavaScript function: (Line numbers are included for reference only.)

The Annual Revenue view column is configured to call the function as shown in the Column Properties exhibit. (Click the Change Column Properties tab.)

Users report that the icons that appear in the Active Accounts view are incorrect, as shown in the Active Accounts View exhibit. (Click the Active Accounts View tab.)

You need to determine why the incorrect icons are being displayed.
For each of the following statements, select Yes if the statement is true. Otherwise, select No.
Hot Area:

Discover Answer Hide Answer

Answer:
Box 1: No -
parseFloat will return 'NaN' if it's not a number (null and undefined are NaNs).

Box 2: No -

Box 3: Yes -
Session.userLCID is the Locale ID for the ASP application.
Reference:
https://support.microsoft.com/en-us/help/229690/how-to-set-the-asp-locale-id-per-the-browser-s-language-settings

Question#85

HOTSPOT -
You develop the following JavaScript code for a web resource that will be used in a model-driven app.

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:

Discover Answer Hide Answer

Answer:
Box 1: Yes -

Problem patterns: Web-use-async -
There are multiple ways to interact with the server or request resources. Common approaches that allow for synchronous communications include the following
(These scenarios should be avoided.):
✑ Usage of the XMLHttpRequest object passing in false for the value of the async parameter for the open function call var requestXhr = new XMLHttpRequest();
// Explicitly setting the async parameter to false or supplying a variable with a value of false will force this as a synchronous call. requestXhr.open('GET', '/test/test.txt', false);

Box 2: No -
=== - Strict Equality Comparison is already used in the code.

Box 3: No -
No debugger statement in the code, so web-remove-debug-script (avoid including debug script in non-development environments) does not apply.
Reference:
https://docs.microsoft.com/sr-cyrl-rs/powerapps/developer/model-driven-apps/best-practices/business-logic/interact-http-https-resources-asynchronously https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_equality

Question#86

A company is creating a Power Apps portal to collaborate with vendors.
You need to implement custom functionality in the portal by using JavaScript code.
Which two portal entities can you use? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.

  • A. Web pages
  • B. Web resources
  • C. Webforms
  • D. Entity lists
Discover Answer Hide Answer

Answer: CD
C: The Web Form Step record contains a field named Custom JavaScript that can be used to store JavaScript code to allow you to extend or modify the form's visual display or function.
D: You can add custom Javascripts to Entity lists.
Reference:
https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/add-custom-javascript https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/entity-lists#add-custom-javascript

Question#87

HOTSPOT -
You need to develop a set of Web API's for a company.
What should you implement? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Discover Answer Hide Answer

Answer:
Box 1: Functions -
most functions and services that are stateless and do not have side effects.

Box 2: Actions -
Actions can have side effects.

Box 3: Complex types -

Complex types -
Complex types are keyless named structured types consisting of a set of properties. These are value types whose instances cannot be referenced outside of their containing entity. Complex types are commonly used as property values in an entity or as parameters to operations.
Incorrect:
* An entity type is a named structured type with a key. It defines the named properties and relationships of a table.
* Enumeration types are named primitive types whose values are named constants with underlying integer values.
Type definitions are named primitive types with fixed facet values such as maximum length or precision. Type definitions can be used in place of primitive typed properties, for example, within property definition
Reference:
https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/webapi/use-web-api-actions https://docs.microsoft.com/en-us/odata/concepts/data-model#complex-types

Question#88

You are developing an app that uses Common Data Service.
You must integrate Common Data Service with a new web application. You must allow the new web application to display data from Common Data Service.
You build a single-page web application using the Web API.
You need to authenticate your app using OAuth.
What should you use?

  • A. Windows Communication Foundation (WCF)
  • B. Cross-Origin Resource Sharing (CORS)
  • C. Microsoft Authentication Library (MSAL)
  • D. Kerberos authentication
Discover Answer Hide Answer

Answer: B
You can create a Single-Page Application (SPA) which uses JavaScript to work with Microsoft Dataverse (Common Data Service) data. To provide this, Cross-
Origin Resource Sharing (CORS) is enabled so that your SPAs can bypass browser restrictions that normally prevent requests that cross domain boundaries.
Reference:
https://docs.microsoft.com/en-us/power-apps/developer/data-platform/oauth-cross-origin-resource-sharing-connect-single-page-application

Question#89

HOTSPOT -
A company has a model-driven app.
A custom button on a form calls a JavaScript function that validates form data fields and creates a web basket. The JavaScript function then displays a message to the user.
Users are located in the United States, which uses ISO Code 1033, and France, which uses ISO Code 1036.
Users in France report that the message displays in English.
You need to modify the RibbonDiffXml file to ensure that messages appear in the user's language.
How should you complete the CommandDefinition node? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Discover Answer Hide Answer

Answer:
Box 1: CrmParameter -
In addition to data values, you can retrieve client context information by using <CrmParameter>. You can use the following options as the value for the
CrmParameter element: OrgName, OrgLcid, and UserLcid.

Box 2: UserLcid -
userLCID is the language code of the current user.
Note: A locale is a set of user preference information related to the user's language. The locale determines how dates, times, currencies, and numbers are formatted, how items are alphabetically sorted, and how strings are compared. The locale identifier (LCID) is a 32-bit value that uniquely defines a locale.
Reference:
https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/customize-dev/pass-dynamics-365-data-page-parameter-ribbon- actions

Question#90

HOTSPOT -
A company has a model-driven app that captures applications from prospective students.
You are asked to create a new re-usable custom component using the Power Apps component framework (PCF).
The custom component must allow entry of a date of birth and validate that the applicant is not a minor.
You create the class AdultDatePicker in the TypeScript file Index.ts and the style sheet DatePicker.css.
You need to define the component to be available only for relevant fields and its properties when used in a form.
How should you complete the manifest? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:

Discover Answer Hide Answer

Answer:
Box 1: AdultDatePicker -
Constructor: Constructor of the code component.

Box 2: DateandTime.DateOnly -
Date Only - No Time zone conversion.
The time portion of the value is always 12:00AM.
The date portion of the value is stored and retrieved as specified in the UI and Web services.

Box 3: bound -
usage: Has two properties, bound and input. Bound properties are bound only to the value of the field. Input properties are either bound to a field or allow a static value.
Reference:
https://docs.microsoft.com/en-us/powerapps/developer/component-framework/manifest-schema-reference/manifest https://docs.microsoft.com/en-us/powerapps/developer/component-framework/implementing-controls-using-typescript https://docs.microsoft.com/en-us/power-apps/maker/data-platform/behavior-format-date-time-field

chevron rightPrevious Nextchevron right