dataverse-web-resources

Use when creating, deploying, or managing Dataverse web resources for model-driven apps. Covers JavaScript form scripts (OnLoad, OnSave, OnChange events), HTML dashboard pages, CSS styling, image resources, navigation/side panes, ribbon/command bar customization, business process flow client API, and deployment via the Web API. Triggers on: "web resource", "javascript form", "form script", "html dashboard", "ribbon command", "onload event", "onchange event", "onsave event", "formContext", "Xrm.WebApi", "web resource deployment", "dashboard page", "form event handler", "side pane", "command bar", "ribbon", "modal dialog", "navigation", "Xrm.App", "Xrm.Navigation", "business process flow", "bpf", "stage change".

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "dataverse-web-resources" with this command: npx skills add danielkerridge/claude-code-power-platform-skills/danielkerridge-claude-code-power-platform-skills-dataverse-web-resources

Dataverse Web Resources Skill

You are an expert in creating, deploying, and using Dataverse web resources within model-driven apps. Web resources are virtual files stored in Dataverse that can contain JavaScript, HTML, CSS, images, and other web content used to extend the application.

CRITICAL RULES

  1. Always use a publisher prefix namespace for web resource names (e.g., cnt_/js/formscript.js). The forward slash creates a virtual folder structure.

  2. JavaScript must use the namespace pattern. Define all functions inside a namespace object to avoid global scope pollution:

    var MyApp = MyApp || {};
    MyApp.FormScripts = { onLoad: function(executionContext) { ... } };
    
  3. Always pass executionContext to form event handlers. Enable "Pass execution context as first parameter" when registering. Then: var formContext = executionContext.getFormContext();

  4. Content must be base64-encoded when creating via the API. Use PowerShell's [Convert]::ToBase64String() or equivalent.

  5. Always publish after creating/updating web resources. They remain in draft until published.

  6. 5MB size limit per web resource (configurable by org admin). Minify large JS/CSS.

  7. Always consult resources/ux-decision-guide.md when choosing controls — before selecting a control type, field format, navigation pattern, or page layout, check the decision guide for the recommended approach.

  8. Xrm is NOT available in web resources loaded via MDA sitemap. Web resources loaded as sitemap SubAreas run in an iframe where Xrm is not injected directly. Use this fallback chain: (1) Xrm.Utility.getGlobalContext(), (2) parent.Xrm.Utility.getGlobalContext(), (3) WhoAmI API call (GET /api/data/v9.2/WhoAmI) for user identity. Cache the result.

  9. Sitemap web resource URL format: Use Url="/WebResources/{name}" (NOT $webresource: prefix) on <SubArea> elements to embed HTML web resources as navigation items.

Quick Reference

OperationMethodEndpoint
Create web resourcePOST/webresourceset
Update web resourcePATCH/webresourceset({id})
Delete web resourceDELETE/webresourceset({id})
Add to solutionActionAddSolutionComponent (ComponentType=61)
PublishActionPublishXml

Xrm Client API Quick Reference

APIPurposeTarget
Xrm.App.sidePanes.createPane()Open persistent side panelWeb resource, custom page, entity form
Xrm.Navigation.navigateTo()Open inline dialog (modal/modeless)Web resource, custom page
Xrm.Navigation.openWebResource()Open web resource in new window/dialogWeb resource
Xrm.Navigation.openForm()Open entity form programmaticallyEntity form
Xrm.Navigation.openAlertDialog()Show alert messageSystem dialog
Xrm.Navigation.openConfirmDialog()Show confirm/cancel promptSystem dialog
Xrm.WebApi.retrieveMultipleRecords()Query records from form JSDataverse table
Xrm.WebApi.createRecord()Create record from form JSDataverse table
Xrm.WebApi.updateRecord()Update record from form JSDataverse table
Xrm.WebApi.deleteRecord()Delete record from form JSDataverse table
formContext.data.process.getActiveProcess()Get active BPFForm process
formContext.data.process.setActiveProcess(id)Switch BPFForm process
formContext.data.process.moveNext() / movePrevious()Navigate BPF stagesForm process
formContext.data.process.addOnStageChange(handler)Listen for BPF stage changesForm process
Xrm.Utility.getResourceString(webresource, key)Get localized string from RESXWeb resource

Resource Files

  • resources/types-reference.md -- All 12 web resource types with Type IDs and use cases
  • resources/js-form-scripts.md -- JavaScript for form event handling, field validation, UI manipulation
  • resources/html-dashboards.md -- HTML pages for dashboards, charts, and KPI displays
  • resources/deployment.md -- Creating and deploying web resources via the API
  • resources/navigation-side-panes.md -- Side panes, dialogs, navigation APIs (Xrm.App, Xrm.Navigation)
  • resources/ribbon-command-bar.md -- Ribbon/command bar customization (modern + classic RibbonDiffXml)
  • resources/ux-decision-guide.md -- Decision trees for control, layout, and navigation pattern selection
  • resources/bpf-client-api.md -- Business Process Flow JavaScript API, events, stage navigation, common patterns

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

dataverse-web-api

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

dataverse-plugins

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

pcf-controls

No summary provided by upstream source.

Repository SourceNeeds Review