PL 400 Model-Driven Apps 4 — Questions and Answers
Question 1: A developer wants to open a model-driven app record form from within a canvas app. Which Power Fx function accomplishes this?
- Launch() with the model-driven app URL and record ID (Correct answer)
- Navigate() with the form name
- Collect() to retrieve the record
- Patch() with the record ID
Correct answer: Launch() with the model-driven app URL and record ID
The Launch() function in canvas apps can open a model-driven app form by passing a constructed URL with the entity and record ID parameters.
Question 2: Which privilege in a security role controls whether a user can create new records for a table in a model-driven app?
- Read privilege
- Write privilege
- Create privilege (Correct answer)
- Append privilege
Correct answer: Create privilege
The Create privilege in a security role specifically governs whether a user can create new records for that table.
Question 3: A developer needs to programmatically refresh a subgrid on a model-driven app form without reloading the entire page. Which API should they call?
- formContext.data.refresh()
- gridControl.refresh() (Correct answer)
- Xrm.WebApi.retrieveMultipleRecords()
- formContext.ui.tabs.refresh()
Correct answer: gridControl.refresh()
The gridControl.refresh() method refreshes the subgrid control data without causing a full form reload.
Question 4: What is the recommended way to associate a JavaScript library with a model-driven app form event?
- Add a script tag in a web resource and reference it in the sitemap
- Register the JavaScript web resource on the form and configure the event handler in form properties (Correct answer)
- Upload the script to Azure Blob Storage and reference its URL
- Add the function directly to the form XML using the XML editor
Correct answer: Register the JavaScript web resource on the form and configure the event handler in form properties
JavaScript web resources are added to a form's library list and then specific functions are registered as event handlers through the form properties editor.
Question 5: Which model-driven app component allows developers to embed a list of related records directly on a parent entity's main form?
- Quick View form
- Subgrid (Correct answer)
- Timeline
- Business Process Flow
Correct answer: Subgrid
A subgrid control on a main form displays related records from a child entity based on a relationship, allowing in-line viewing and interaction.
Question 6: A developer needs to make a field visible only when another field has a specific value in a model-driven app form. What is the simplest approach that requires no JavaScript?
- Custom plug-in on Retrieve
- Business rule with Show/Hide action (Correct answer)
- Computed column in Dataverse
- OnSave JavaScript event handler
Correct answer: Business rule with Show/Hide action
Business rules with Show/Hide actions can conditionally show or hide fields based on field values without requiring any JavaScript code.
Question 7: Which table relationship type in Dataverse creates a cascade behavior that deletes child records when the parent is deleted?
- Many-to-many relationship with cascade delete
- One-to-many relationship with Delete cascade behavior set to Cascade All (Correct answer)
- One-to-many relationship with Delete cascade set to Restrict
- Activity relationship with parental behavior
Correct answer: One-to-many relationship with Delete cascade behavior set to Cascade All
A one-to-many relationship with the Delete cascade behavior set to 'Cascade All' automatically deletes all related child records when the parent record is deleted.
A developer wants to open a model-driven app record form from within a canvas app.
Which Power Fx function accomplishes this?