PL-400 practice question 15 of 35

You are creating a model-driven app. You create JavaScript code to display a message when a record is saved. You need to configure the associated JavaScript web resource name when adding the event handler to the form. Which field should you use?

Full set: 391 questions

Domain Extend the platform

Answer options
A: Event Type
B: Function
C: Component
D: Library Correct answer
Correct Answer:
D. Library
Explanation

When configuring a client-side script to run on a model-driven app form event, you must first associate the JavaScript file with the form. This JavaScript file is stored in the environment as a web resource. In the form's event handler configuration dialog, the Library field is used to look up and select the specific JavaScript web resource that contains the function you intend to execute. After selecting the library, you then specify the name of the function in the Function field.

Why Incorrect

A. Event Type: This field specifies the trigger for the code, such as OnSave or OnLoad, not the JavaScript file itself.
B. Function: This field is used to enter the name of the specific function within the selected library, not the library (web resource) itself.
C. Component: This term is too general. While events can be tied to specific form components (like fields), the field for adding the script file is named 'Library'.

References

1. Microsoft Learn. "Walkthrough: Write your first client script for model-driven apps". In the section titled "Add your script to a form," the steps and accompanying screenshot clearly show that the Library field is used to add the JavaScript web resource to the event handler.

2. Microsoft Learn. "Configure an event handler for a model-driven app form". The section "Add an event handler to a form" details the process: "On the Events tab, under Event Handlers, select + Event Handler. On the Configure Event pane, the first step is to select a Library by using '+ Add library'." This confirms 'Library' is the correct field.

Scroll to Top