Dynamics Documentation
Dataverse solutions and web resources for the Time Finance Dynamics / Leasepath work.
Repository
Source repo: timefinance-dynamics
Key idea:
- Dataverse environment - where the web resources, forms, tables actually live.
- Solutions - lists of components that make up a deployable package.
- This repo - unpacked solution files, used as the source of truth for code and config.
pac moves between solution <-> repo.
Dataverse DevTools moves between repo file <-> environment web resource.
Overview
Solution strategy
We use a single main solution to own all Leasepath-related Customizations:
- LeasepathCustomizations - app references, cloned forms, custom web resources, flows/plugins, config tables.
Optional:
- SharedWebResources - only if we genuinely have shared web resources used across multiple apps/areas.
We do not create one solution per feature. Feature isolation is done via Git branches and PRs.
Repo layout
timefinance-dynamics/
solutions/
LeasepathCustomizations/ # main solution for all Leasepath Customizations
Solution.xml
Customizations.xml
Other/
WebResources/ # present only if this solution contains any
onepc_/Pages/
AttachedDocuments.html # web resource as it exists in the solution
AttachedDocuments.html.data.xml # metadata for the web resource
SharedWebResources/ # optional shared-only solution
Solution.xml
Customizations.xml
Other/
WebResources/
onepc_/Common/
SomeSharedResource.html
SomeSharedResource.html.data.xml
artifacts/ # exported solution zips (unmanaged + managed)
README.md
solutions/- one folder per Dataverse solution (named bySolutionUniqueName), populated bypac solution unpack.WebResources/under each solution - files for HTML/JS/CSS web resources owned by that solution.artifacts/- exported solution ZIPs frompac solution exportorpac solution pack.
Typical flow for LeasepathCustomizations:
- Make or add components in Sandbox inside
LeasepathCustomizations. - Export and unpack into
solutions/LeasepathCustomizations/. - Edit local web resource files there, using DevTools Upload for quick Sandbox testing.
- Export and unpack again, then commit so Git matches Sandbox.
- Pack from
solutions/LeasepathCustomizationswhen creating a ZIP for Prod.
Getting started
Prerequisites
- Access to the Time Sandbox environment
URL:https://timefinancesandbox.crm11.dynamics.com - Dataverse solution in Time Sandbox
Example: display nameLeasepath Customizations, unique nameLeasepathCustomizations - Git installed
- Power Platform CLI (
pac) installed and on yourPATH - (Optional) Visual Studio Code with:
- Power Platform Tools extension
- Dataverse DevTools extension
On macOS use device-code auth with
pac auth create.
Authenticate pac against Time Sandbox
Run once:
pac auth create \
--url "https://timefinancesandbox.crm11.dynamics.com" \
--name time-sandbox \
--deviceCode
Then select and verify:
pac auth select --name time-sandbox
pac org list
Expected:
Friendly Name Url
-------------- ----------------------------------------------
Time Sandbox https://timefinancesandbox.crm11.dynamics.com
Solutions and web resources
Dataverse rule of thumb: if a component is not in a solution, it is not part of any deployable package.
pac solution exportonly includes components listed in that solution.pac solution unpackonly writes files for components that belong to that solution. If the solution has no web resources, there will be noWebResources/folder.
To have a web resource show up under solutions/LeasepathCustomizations/WebResources/:
- Create it in the environment.
- Add it to
LeasepathCustomizationsin the maker portal: open the solution -> Add existing -> Web resource -> select the resource -> save. - Export + unpack the solution into this repo.
Shared assets can live in SharedWebResources if needed. Add those web resources to that solution, export/unpack into solutions/SharedWebResources/, and commit changes from that folder when they change.
Each solution folder in Git holds only the components that solution owns - do not duplicate the same web resource in multiple solution folders.
You edit the .html (or .js/.css) file. The .data.xml metadata file is maintained by pac and DevTools; do not hand edit it.
Sync a solution with Sandbox (export -> unpack -> commit)
All commands run from the repo root timefinance-dynamics.
Most of the time you will be syncing LeasepathCustomizations. Replace <SolutionUniqueName> if you are syncing a different solution.
- Export from Time Sandbox
pac auth select --name time-sandbox
pac solution export \
--name <SolutionUniqueName> \
--path ./artifacts \
--managed false \
--overwrite
Example:
pac solution export \
--name LeasepathCustomizations \
--path ./artifacts \
--managed false \
--overwrite
- Unpack into
solutions/<SolutionUniqueName>
pac solution unpack \
--zipFile ./artifacts/<SolutionUniqueName>.zip \
--folder ./solutions/<SolutionUniqueName> \
--allowDelete true
Example:
pac solution unpack \
--zipFile ./artifacts/LeasepathCustomizations.zip \
--folder ./solutions/LeasepathCustomizations \
--allowDelete true
This writes the unpacked solution files into:
solutions/<SolutionUniqueName>/
Solution.xml
Customizations.xml
Other/
WebResources/
...
- Commit to Git
git status
git diff
git add solutions/<SolutionUniqueName>
git commit -m "Update <SolutionDisplayName> solution"
git push
This is the environment -> solution -> repo sync. DevTools uploads (see below) change the environment; this export/unpack step pulls those changes into Git.
Team workflow
Use feature branches and keep everything flowing through LeasepathCustomizations.
Environment-first (default)
Best for forms, views, flows, and early HTML/JS changes.
Branch:
git checkout main
git pull
git checkout -b feature/<short-description>
In Time Sandbox, inside LeasepathCustomizations:
- Update forms/views.
- Create or edit web resources.
- Add or change flows or plugins.
When a chunk of work is ready:
pac solution export \
--name LeasepathCustomizations \
--path ./artifacts \
--managed false \
--overwrite
pac solution unpack \
--zipFile ./artifacts/LeasepathCustomizations.zip \
--folder ./solutions/LeasepathCustomizations \
--allowDelete true
git status
git diff
git add solutions/LeasepathCustomizations
git commit -m "Describe the change briefly"
git push
Open a PR, review, merge to main.
Always refresh from main before starting a new branch:
git checkout main
git pull
Web resource development with Dataverse DevTools
Dataverse DevTools gives you a fast file <-> Sandbox loop for web resources, instead of doing full pac solution pack/import for every edit.
Think:
pac- moves whole solutions between Sandbox and Git.- DevTools Upload - moves a single
.html/.jsfile between Git and Sandbox.
One-time setup (LeasepathCustomizations)
Export + unpack the solution at least once so the files exist locally under:
solutions/LeasepathCustomizations/WebResources/
Example:
solutions/LeasepathCustomizations/WebResources/onepc_/Pages/AttachedDocuments.html
In VS Code:
- Install Dataverse DevTools.
- Connect to Time Sandbox and make sure the connection is active.
- Use Smart Match:
- Open Smart Match from the Dataverse DevTools WEB RESOURCES panel.
- Point Smart Match at
solutions/LeasepathCustomizations/WebResources/. - For each file you care about (for example
AttachedDocuments.html), link it to the existing web resourceonepc_/Pages/AttachedDocuments.html(Web Resource Id should appear, confidence 100).
Smart Match now knows that:
Local file solutions/.../AttachedDocuments.html <-> Sandbox web resource onepc_/Pages/AttachedDocuments.html
Daily loop for HTML/JS
-
Edit the local file in VS Code, e.g.:
solutions/LeasepathCustomizations/WebResources/onepc_/Pages/AttachedDocuments.html - In Smart Match, Upload (or Upload All Linked).
- DevTools uploads that file to the linked web resource in Sandbox and publishes it.
- Refresh the app and test.
- Repeat 1-4 as often as needed. No solution pack/import required for this inner loop.
When you are ready to land changes in Git:
pac solution export --name LeasepathCustomizations --path ./artifacts --managed false --overwrite
pac solution unpack --zipFile ./artifacts/LeasepathCustomizations.zip --folder ./solutions/LeasepathCustomizations --allowDelete true
git add solutions/LeasepathCustomizations
git commit -m "Describe the change briefly"
Notes:
- You edit the
.htmlfile; the.html.data.xmlmetadata file is maintained bypac/DevTools. - Do not use the browser HTML editor once DevTools mapping is in place; local files plus DevTools keep diffs clean.
Release and deployment
Pack from main so the ZIP matches the repo state.
Create deployment ZIPs from Git
From repo root:
git checkout main
git pull
- Ensure the solution version is correct in Sandbox or via
pac solution version. - Pack an unmanaged ZIP from the unpacked source:
pac solution pack \
--folder ./solutions/LeasepathCustomizations \
--zipFile ./artifacts/LeasepathCustomizations_<version>_unmanaged.zip \
--packageType Unmanaged
- (Optional) import that unmanaged ZIP into Sandbox to confirm it reproduces the current state.
Produce a managed ZIP for Prod
If your pac version supports it:
pac solution pack \
--folder ./solutions/LeasepathCustomizations \
--zipFile ./artifacts/LeasepathCustomizations_<version>_managed.zip \
--packageType Managed
Otherwise, import the unmanaged ZIP into a build or staging environment and export a managed version from there.
Import to Production
- In Prod:
make.powerapps.com -> Prod -> Solutions -> Import. - Select the managed ZIP (for example
LeasepathCustomizations_1_0_0_1_managed.zip). - Publish all customizations.
- In the app, set any cloned forms (such as the Account/Opportunity form using your custom AttachedDocuments web resource) as default for the correct roles.
SharePoint Folder Structure (Sandbox settings)
For the “Sharepoint Folder Structure” story, we update environment data in Sandbox (not repo files).
Location: PowerApps > Time Sandbox > Tables > Leasepath Configuration
Columns updated for testing:
- Opportunity SharePoint Library
- Enable SharePoint Attached Documents
- Client App Registration ID
When Sandbox testing is finished, revert these values to the baseline/production-aligned values.