$120 tested Claude codes · real before/after data · Full tier $15 one-timebuy --sheet=15 →
$Free 40-page Claude guide — setup, 120 prompt codes, MCP servers, AI agents. download --free →
clskills.sh — terminal v2.4 — 2,347 skills indexed● online
[CL]Skills_
Dynamics 365beginnerNew

D365 Model-Driven App

Share

Build model-driven apps with forms, views, and business rules

Works with OpenClaude

You are a Dynamics 365 developer building model-driven apps. The user wants to create a functional model-driven app with custom forms, views, and business rules using the Power Apps interface and JavaScript customizations.

What to check first

  • Verify you have a Dynamics 365 environment with at least System Administrator or System Customizer security role
  • Confirm the table (entity) you want to build the app around already exists or create a new one in the Data workspace
  • Check that you have access to Power Apps (https://make.powerapps.com) and can see your environment

Steps

  1. Open Power Apps and navigate to your Dynamics 365 environment, then create a new Model-driven application from the Apps page
  2. Add your target table to the app's Site Map by dragging it into the navigation structure under a group
  3. Create a Main form by opening the table's Form editor and selecting "Main" form type, then add columns as sections and fields
  4. Add a Quick Create form for rapid data entry by creating a new form and setting Form Type to "Quick Create"
  5. Create custom views by opening the table's Views section and defining filter criteria, columns to display, and sort order
  6. Add a business rule by navigating to the table's Business Rules, defining condition blocks, and setting actions (Set field value, Show error message, Lock field)
  7. Add form JavaScript customization by opening the form editor, selecting Form Libraries, uploading a web resource, and configuring OnLoad and OnChange event handlers
  8. Test the app in preview mode, verify form field validations trigger correctly, and confirm views filter and sort as expected
  9. Publish customizations and assign the app to security roles

Code

// Form OnLoad event handler - initialize form state and set default values
function formOnLoad(executionContext) {
    var formContext = executionContext.getFormContext();
    var entityName = formContext.data.entity.getEntityName();
    var recordId = formContext.data.entity.getId();
    
    // Set default value for a field
    formContext.getAttribute("new_department").setValue("Sales");
    
    // Lock fields based on record status
    var statusValue = formContext.getAttribute("statuscode").getValue();
    if (statusValue === 2) { // Closed
        formContext.getControl("new_amount").setDisabled(true);
    }
    
    // Make a field mandatory
    formContext.getAttribute("new_customername").setRequiredLevel("required");
    
    // Show/hide sections based on conditions
    var accountType = formContext.getAttribute("new_accounttype").getValue();
    if (accountType === "Customer") {
        formContext.ui.tabs.get("CreditDetails").sections.get("CreditSection").setVisible(true);
    } else {
        formContext.ui.tabs.get("CreditDetails").sections.get("CreditSection").setVisible(false);
    }
}

// Field OnChange event handler - validate and update dependent fields
function fieldOnChange(executionContext) {

Note: this example was truncated in the source. See the GitHub repo for the latest full version.

Common Pitfalls

  • Treating this skill as a one-shot solution — most workflows need iteration and verification
  • Skipping the verification steps — you don't know it worked until you measure
  • Applying this skill without understanding the underlying problem — read the related docs first

When NOT to Use This Skill

  • When a simpler manual approach would take less than 10 minutes
  • On critical production systems without testing in staging first
  • When you don't have permission or authorization to make these changes

How to Verify It Worked

  • Run the verification steps documented above
  • Compare the output against your expected baseline
  • Check logs for any warnings or errors — silent failures are the worst kind

Production Considerations

  • Test in staging before deploying to production
  • Have a rollback plan — every change should be reversible
  • Monitor the affected systems for at least 24 hours after the change

Quick Info

CategoryDynamics 365
Difficultybeginner
Version1.0.0
AuthorClaude Skills Hub
dynamics365model-drivenapp

Install command:

curl -o ~/.claude/skills/d365-model-driven.md https://clskills.in/skills/dynamics365/d365-model-driven.md

Related Dynamics 365 Skills

Other Claude Code skills in the same category — free to download.

Want a Dynamics 365 skill personalized to YOUR project?

This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.