exam questions

Exam PL-400 All Questions

View all questions & answers for the PL-400 exam

Exam PL-400 topic 5 question 3 discussion

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

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.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
Cdric
Highly Voted 3 years, 11 months ago
"You determine that the JavaScript function is calling another JavaScript function in a different web resource." From this statement, the correct answer is A
upvoted 26 times
Violoncello
2 years, 10 months ago
There's no JavaScript code to include another JavaScript code file. A is impossible. However, the Form can contain all needed Webresources in its Library.
upvoted 1 times
...
...
shavarse
Highly Voted 3 years, 3 months ago
Tested - answer is C.
upvoted 16 times
...
Juan0414
Most Recent 2 months, 3 weeks ago
Selected Answer: A
Correct! You go to the web resource (Edit) and the other web resource as a dependency (View dependencies -> add dependency -> Select web resource and add)
upvoted 1 times
...
DevInProgress
5 months, 3 weeks ago
Selected Answer: A
The correct solution is A, because you must ensure that the JavaScript web resource with the called function is registered as a dependency of the web resource attempting to invoke that function. This ensures that all necessary scripts are loaded and available when the button is clicked.
upvoted 1 times
...
sadzag
1 year, 8 months ago
A is correct
upvoted 1 times
...
MikeAWS
1 year, 8 months ago
A is correct answer. Adding the missing web resource as a dependency ensures that it is loaded and available when the JavaScript function is called from the button. This way, you can avoid issues related to missing dependencies.
upvoted 1 times
...
jkaur
1 year, 9 months ago
A should be correct.
upvoted 1 times
jkaur
1 year, 9 months ago
C is correct
upvoted 1 times
...
...
Moradmoro
2 years, 3 months ago
Selected Answer: C
C Is correct
upvoted 1 times
...
DimpleG
2 years, 3 months ago
Selected Answer: A
In the JavaScript web resource, add the missing web resource as a dependency. This will ensure that the missing web resource is loaded and available for the JavaScript function to call. By adding the dependency, you can ensure that the web resource is loaded before the function that calls it is executed. Option C, "From the Ribbon Workbench, add the missing JavaScript web resource as a CustomRule in EnableRules" is not the correct answer because the Ribbon Workbench is a tool used to customize the ribbon and command bars in Dynamics 365 and it is not related to resolving JavaScript function errors. The correct action is to ensure that the missing web resource is loaded by adding it as a dependency in the JavaScript web resource that calls it.
upvoted 5 times
...
Fyrus
2 years, 4 months ago
Selected Answer: A
You can argue that C is not the most elegant solution. that it's a "dumb & unintuitive way to achieve this" but it surely works and it's the most safe way to include files in the ribbon
upvoted 1 times
...
Moradmoro
2 years, 7 months ago
Selected Answer: C
answer is C.
upvoted 1 times
...
Flatternschuchtern
2 years, 8 months ago
Selected Answer: A
What are you guys talking about? You go to the JS WebResource and add the dependency to another JS WebResource, and it will be loaded to the page automatically, this is the correct way to do things. I GUESS c will work too but it looks like a dumb & unintuitive way to achieve this
upvoted 1 times
...
Kalimho
2 years, 10 months ago
in exam 2022.07.21
upvoted 1 times
MikeAWS
1 year, 9 months ago
So, what was correct answer, what is your opinion?
upvoted 1 times
...
...
Parth91
2 years, 10 months ago
Selected Answer: C
Answer is C
upvoted 2 times
...
S41
3 years, 10 months ago
In the JavaScript code, you can load the dependent JavaScript file. The other way to do this is to register the dependent JavaScript in the Form properties for the form. For the grid view page this can be done in the Ribbon workbench by defining custom action to add the JavaScript file without any function or (IsNaN). It is certainly no the EnableRules option as mentioned in the answer C. So the correct answer is A
upvoted 6 times
piboke
3 years, 6 months ago
form scripts don't work on ribbons. You need to add them to the ribbon, and a custom rule referencing the js script is the way to go.
upvoted 2 times
...
Ami_Nou
3 years, 4 months ago
This feels most correct
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 ...