PL-400 Exam QuestionsBrowse all questions from this exam

PL-400 Exam - Question 327


You are implementing business logic for a model-driven app form by using multiple JavaScript web resources.

The business logic, number of JavaScript files, and the columns that the business logic requires are expected to change frequently. Some form fields will not be visible. Occasionally, non-developers will also make changes to the form.

You need to prevent columns referenced by the JavaScript from accidentally being removed from the form based.

What should you do?

Show Answer
Correct Answer: D

To ensure columns referenced by JavaScript files are not accidentally removed from the form, you should add these columns as dependencies in each JavaScript file. This approach allows the columns to be available within the client API columns collection, ensuring that even if the form elements are not visible, the necessary data remains accessible for the JavaScript business logic. This prevents non-developers or others from accidentally removing the columns from the form, as the dependencies are explicitly defined.

Discussion

8 comments
Sign in to comment
DimpleGOption: D
Jan 28, 2023

By adding the columns that each JavaScript file references as dependencies, you can ensure that the columns required by the business logic will not be accidentally removed from the form. This will provide visibility into which columns are being used by the business logic, and make it easier to identify and update any dependencies if changes are made to the form or the JavaScript files. Additionally, you can use the dependency information to automate the process of adding or removing columns as needed.

kvargas90Option: D
Oct 13, 2022

Correct

CRMBugOption: D
Nov 12, 2022

Correct

MarioMOption: C
Sep 25, 2022

Add all columns as non-event dependencies to the form.

MarioM
Sep 25, 2022

Ignore. Answer is correct. Starting with Dynamics 365 for Customer Engagement apps version 9.0, if your JavaScript web resource depends on an entity attribute value that you don’t want to display in the form, you can set the attribute as a dependency for the JavaScript web resource. This means that the attribute will be available within the client API attributes collection so you can get or set the value in your code. When you add a dependency this way, the controls collection of the attribute will be empty because there will be no control on the form. Before this feature you would need to manually add the attribute to the form and then configure the control to be hidden. Now you can establish this dependency more directly and eliminate the possibility that someone will remove the hidden field from the form.

Pl4002024
Aug 31, 2024

You CANNOT ADD columns to js files. Only for the js events!!! The C is the right ans

Juan0414Option: D
Mar 6, 2025

Correct!

LEILA1234Option: C
Apr 10, 2025

To prevent columns referenced by the JavaScript from accidentally being removed from the form, you should: C. Add all columns as non-event dependencies to the form. This ensures that the columns are recognized as dependencies by the form, preventing them from being removed even if they are not directly visible or used in the form's events. This approach helps maintain the integrity of the business logic and the JavaScript web resources.

itmaxuserOption: D
Apr 15, 2025

C. Add all columns as non-event dependencies to the form. Select the fields that are required by any external, non-event scripts. Fields in the Dependent Fields list will not be removable from the form.