Troubleshooting - REFRACT Platform for Dynamics 365 Sales
Diagnose and resolve common REFRACT Platform CRM issues. Security role errors, environment variable misconfigurations, plugin failures, SharePoint connectivity, workflow enforcement, and batch operation problems.
Quick Diagnostics
Use this flowchart to identify common issues quickly:
-
Do Command Bar buttons appear on CRM records?
- No → See Command Bar Buttons Not Visible
- Yes → Continue
-
Does clicking a button return an access error?
- Yes → See Security Role Issues
- No → Continue
-
Does the Template Gallery open but show no templates?
- Yes → See Template Gallery Is Empty
- No → Continue
-
Does document generation fail?
- Yes → See Document Generation Failures
- No → Continue
-
Is workflow enforcement blocking CRM operations unexpectedly?
- Yes → See Workflow Enforcement Issues
- No → Setup is working correctly
Command Bar Buttons Not Visible
Symptom: "No REFRACT buttons appear on Quote, Opportunity, or Account records"
The managed solution may not be installed in the correct environment, or the Command Bar customisations have not propagated.
Verify the Managed Solution Is Installed
- Open Power Platform Admin Center
- Select the target environment → Solutions
- Confirm REFRACT Platform for D365 Sales is listed with status Installed
If the solution is not listed, import it from the solution file provided by Refract Logic.
Hard Refresh the Browser
- Close all Dynamics 365 tabs
- Open a new tab and navigate to Dynamics 365
- Open a Quote or Opportunity record
- Check for the Command Bar buttons
Command Bar customisations load from the server-side metadata cache. A hard refresh forces the browser to reload this cache.
Verify Command Bar in App Designer
If buttons are still missing after a hard refresh:
- Open Power Apps (make.powerapps.com)
- Select Apps → find and open the model-driven app your sales team uses (e.g. Sales Hub)
- Click Edit → navigate to the relevant entity form (Quote, Opportunity, etc.)
- In the Command Bar editor, confirm REFRACT actions are present
If buttons are missing from the App Designer, the managed solution may need reimporting into the correct environment.
Security Role Issues
Symptom: "Access denied" when clicking a Command Bar button
The user does not have the REFRACT User security role assigned.
Assign the REFRACT User Security Role
- In Dynamics 365, navigate to Settings → Security → Users
- Open the affected user's record
- Click Manage Roles
- Check the REFRACT User role and click OK
The role is included in the managed solution. If it does not appear in the role list, the solution may not be installed correctly.
Verify the Role Exists
- Navigate to Settings → Security → Security Roles
- Confirm REFRACT User appears in the list
- If missing, reimport the managed solution - the role is delivered as part of the solution package
Sign Out and Sign Back In
Security role changes take effect after the user's next sign-in. Ask the affected user to sign out of Dynamics 365 and sign back in.
Template Gallery Is Empty
Symptom: "The Template Gallery shows no templates when [Process Document] is clicked"
No templates are assigned to the current entity, or all templates are inactive.
Confirm Templates Exist
- Open Power Apps, select your environment, and navigate to Tables. Search for
refract_template - Navigate to Templates
- If the list is empty, create at least one template. See the main setup guide for steps.
Check Template Is Active
- In the Templates list, confirm Is Active is Yes for the relevant template
- Inactive templates are excluded from the gallery even if assigned
Verify Template Assignment
- In Power Apps → Tables, open refract_templateassignment
- Confirm an assignment exists for the relevant template with the correct Entity Logical Name
Example: For Quotes, the entity logical name is quote (all lowercase). If the assignment uses Quote or Quotes, it will not match.
Check Context Setting
- On the Template Assignment record, confirm Context is set to
form,view, orboth - If Context = view and the user is on a record form, the template does not appear
- Adjust the context to
bothto make the template available in all locations
Document Generation Failures
Symptom: "An error occurred while calling the Dispatcher" after clicking Generate
The plugin cannot authenticate with or reach the Dispatcher.
Verify Dispatcher Environment Variables
- In Power Platform Admin Center, open the environment → Solutions → REFRACT Platform for D365 Sales → Environment variables
- Confirm all five Dispatcher variables are populated:
refract_dispatcher_baseurlrefract_dispatcher_tenantidrefract_dispatcher_clientidrefract_dispatcher_clientsecretrefract_dispatcher_scope(api://<dispatcher-app-client-id>/.default)
All five must have current values. refract_dispatcher_clientid must be the Dynamics 365 Sales connector app's client ID, not the client ID of "REFRACT Dispatcher API". An expired or missing refract_dispatcher_clientsecret is the most common cause of authentication failures.
Rotate the Dispatcher Client Secret
- In Azure Portal, open App Registrations → the Dynamics 365 Sales connector app
- Click Certificates & Secrets
- Check the Expires date on the secret in use
- If expired, click New client secret - set expiry to 24 months and copy the Value
- Update
refract_dispatcher_clientsecretin Power Platform with the new value
Value, Not Secret ID
Copy the secret Value, not the Secret ID. The Value is shown only once at creation time.
Test Dispatcher Reachability
Ask your network or Azure team to confirm:
- The Dispatcher Function App is running
- Outbound HTTPS connections from Dataverse to the Dispatcher domain are allowed
- The Dispatcher base URL (
refract_dispatcher_baseurl) is correct and reachable
Symptom: "SharePoint upload failed with 403 Forbidden"
The plugin cannot authenticate with Microsoft Graph or lacks write permission on the SharePoint library.
Verify Graph Environment Variables
- Confirm all four Graph variables are populated:
refract_graph_tenantidrefract_graph_clientidrefract_graph_clientsecretrefract_graph_driveid
An expired refract_graph_clientsecret or incorrect refract_graph_driveid causes 403 errors.
Check Azure AD App Permissions
- In Azure Portal, open App Registrations → REFRACT SharePoint Access
- Click API permissions
- Confirm
Sites.ReadWrite.Allis listed with status Granted for your tenant
If status shows "Needs admin consent":
- Click Grant admin consent for [your tenant]
- Confirm in the dialog
Verify the Drive ID
- Use Microsoft Graph Explorer
- Authenticate with your Azure AD account
- Run:
GET /sites/{siteId}/drives - Find the drive for your output document library and copy its
id - Update
refract_graph_driveidwith this value
A Drive ID from the wrong library or a SharePoint site ID (not a drive ID) causes upload failures.
Symptom: "Template not found" error from the Dispatcher
The Dispatcher cannot locate the template file in SharePoint.
Verify Template Variant ID
- In Power Apps → Tables, open refract_template and find the relevant template
- Check the Template Variant ID field - this must match the exact filename/path used in the REFRACT template library
- Confirm with your Refract Logic deployment contact that the template is published to SharePoint
Verify SharePoint Template Library Access
The same Graph API app registration must have read access to the templates library. Confirm Sites.ReadWrite.All is granted - this covers both read and write access.
Workflow Enforcement Issues
Symptom: "Operation blocked by REFRACT Platform" when activating a Quote or closing an Opportunity
The RefractWorkflowEnforcerPlugin is blocking the operation because a pending workflow is detected.
Sync the Workflow Status
- Open the blocked CRM record
- Click [Sync Workflow Status] in the Command Bar
- Check the dialog for the current workflow state
If the workflow is Complete, the enforcer will allow subsequent operations. If the workflow is still In Progress, the enforcer correctly blocks the operation until the workflow completes.
Check Enforcement Mode on the Template
- In Power Apps → Tables, open refract_template
- Find the template used to generate the document on this record
- Check Workflow Enforcement Mode:
Block- CRM operation is prevented with an error until workflow is completeValidate- Also prevented with an error. A Dataverse pre-operation plugin cannot show a dismissible warning and then let the save continue, soValidatebehaves the same asBlocktodayNone- No enforcement
If enforcement is unwanted for this use case, only None disables the block; Validate will not help.
This only applies to Quote and Opportunity - the enforcement plugin has no registered step for any other entity, regardless of what enforcement mode a template on another entity specifies.
Enforcement Is Set at Generation Time
The enforcement mode stored in refract_documentlink is copied from the template at the time the document was generated. Changing the template's enforcement mode does not retroactively change the mode stored on existing document links. Regenerate the document to apply a new enforcement mode.
Clear a Stale Workflow Link
If a workflow was abandoned and the document link is blocking operations incorrectly, an administrator can update refract_documentlink.refract_workflowstate to complete directly in Dataverse (Advanced Find or a custom admin page). This releases the enforcer block.
Contact sales@refractlogic.com if you need a supported admin utility for this operation.
Workflow Status Issues
Symptom: "Sync Workflow Status shows 'Workflow not found'"
The Dispatcher has no record of the workflow ID stored in refract_documentlink.
Verify the Workflow Was Triggered
Workflow routing requires the template to have Workflow Enabled = Yes and at least one workflow recipient configured. If these were not set at generation time, no workflow was created - regenerate the document with a correctly configured template.
Check for Workflow Expiry
REFRACT Platform workflows expire after a configured period (default: 7 days for e-signature). If the workflow has expired, the Dispatcher discards the workflow instance.
Regenerate the document to initiate a new workflow.
Symptom: "Workflow recipients do not receive invitations"
The workflow was triggered but recipients did not receive an email notification.
Verify Recipient Configuration
- In Power Apps → Tables, open refract_templaterecipient
- Confirm at least one recipient has Recipient Type = Workflow and a valid email address
- Check for typos in the email address
Check Dispatcher Workflow Logs
Contact sales@refractlogic.com with:
- Document ID
- Timestamp of generation
- Recipient email address
Dispatcher logs reveal whether the workflow engine received the request and what the email delivery service returned.
No List-View or Multi-Record Processing
"I selected multiple records in a list view and clicked Process Document, and nothing happened"
There is no such action to click. All four Command Bar actions (Process Document, Open Document, Sync Workflow Status, Get Signed Document) are registered form-only, for a single open record - there is no list-view or grid Command Bar button, and the refract_ProcessDocument Custom API only ever accepts one recordId per call.
The refract_template.refract_dispatchmode field (Standard/Per Record/Single Array/Grouped Array) and the refract_batchwarningthreshold/refract_batchmaxthreshold environment variables exist in the data model, mirroring the Business Central schema, but no CRM plugin code reads them. Changing them has no effect - to process many records, generate documents one at a time from each record's form.
Performance and Timeout Issues
Symptom: "Process Document hangs for over 30 seconds before failing"
The plugin's HTTP client to the Dispatcher has a 90-second timeout. If a call to refract_ProcessDocument fails after roughly 90 seconds, that is the timeout being hit, not a shorter arbitrary limit. If Process Document regularly takes longer than 15 seconds without failing, a configuration problem is likely rather than template complexity.
Check for a Missing or Misconfigured Dispatcher URL
A wrong refract_dispatcher_baseurl will cause the connection to hang until Dataverse times out the operation.
- Verify
refract_dispatcher_baseurlis set correctly in Environment Variables - Confirm the Dispatcher Function App is running in Azure Portal
- If the URL is correct but the Dispatcher is down, contact sales@refractlogic.com with the error detail from the Plugin Trace Log
Check SharePoint Upload Performance
Slow SharePoint uploads are the most common cause of long execution times. Common causes:
- The SharePoint Drive ID points to a library in a different region from the Dataverse environment
- Transient Microsoft Graph throttling (HTTP 429)
If SharePoint uploads are consistently slow, contact sales@refractlogic.com for guidance.
Symptom: "User sees a spinner while Process Document is running"
This is expected behaviour for complex templates. Process Document uploads the record payload to SharePoint, then calls the Dispatcher to render the PDF before returning to the user. The Dispatcher render call is the largest variable, and rendering time scales with template complexity - the number of conditional sections and amount of data the template resolves. SharePoint upload time depends on region and current Microsoft Graph throttling.
The other three actions (Open Document, Sync Workflow Status, Get Signed Document) do not call the Dispatcher's render pipeline, so they complete faster than Process Document.
If response time is a concern, discuss template complexity with your Refract Logic contact.
Plugin and Solution Issues
Symptom: Plugin errors appear in Dataverse Plugin Trace Logs
Enable Plugin Trace Logging
- In Dynamics 365, navigate to Settings → Administration → System Settings
- On the Customization tab, set Enable logging to plug-in trace log to All
- Retry the failing action
- Navigate to Settings → Plugin Trace Log to view error details
Disable After Troubleshooting
Plugin trace logging generates significant data. Disable it after troubleshooting by setting it back to Off or Exception.
Common Plugin Errors
| Error | Cause | Resolution |
|---|---|---|
NullReferenceException on refract_graph_driveid | Environment variable is empty | Populate refract_graph_driveid |
HTTP 401 from Dispatcher | Dispatcher credentials expired or incorrect | Rotate refract_dispatcher_clientsecret |
HTTP 403 from Graph API | Graph App Registration lacks admin consent | Grant admin consent for Sites.ReadWrite.All |
No refract_templateassignment found | Template not assigned to this entity | Create a Template Assignment for the entity |
refract_documentlink not found | Open Document or Sync Status called before Process Document | Run Process Document first |
Symptom: Managed solution upgrade fails or causes data loss
Always Use Managed Solution Imports for Upgrades
Upgrading by importing a new managed solution version preserves all existing Dataverse table data. The import process performs a schema upgrade, adding new columns or tables as needed.
Do not delete the solution before importing the new version - this removes all template configuration data.
Back Up Configuration Before Upgrading
Before importing a new solution version:
- Export your template configuration as a Dataverse export or use Power Platform Dataflows
- Document your Environment Variable values (except secrets)
- Confirm with your implementation team that the new version is backward-compatible with existing template variant IDs
Common Questions (FAQ)
Q: Can REFRACT Platform for Dynamics 365 Sales be used without Business Central?
A: Yes. This integration is completely standalone. It requires only a Dynamics 365 Sales environment, a REFRACT Dispatcher deployment, and Microsoft Graph access. There is no dependency on Business Central or any ERP.
Q: Can I add REFRACT Platform to custom entities or entities not in the initial list?
A: Yes. The plugin works generically for any Dataverse entity. Add a Command Bar customisation for the target entity in a solution update and create template assignments for it - no plugin code changes are required.
Q: Should I expect a cold-start delay on the first "Process Document" of the day?
A: The Dispatcher's default hosting plan is Azure Functions Flex Consumption. New installations get one always-ready Dispatcher instance by default, which avoids the cold-start delay on the first call after a period of inactivity. Deployments installed before that default keep their live setting, which is none unless someone set it by hand, until a redeploy passes it: infra/deploy.ps1 -AlwaysReadyInstances 1 -AllowChange AlwaysReadyInstances. A redeploy that does not pass -AlwaysReadyInstances keeps the live value. If you are consistently seeing a large delay on the first call of the day, check with your deployment team how many always-ready instances your Dispatcher has.
The plugin's own HTTP client to the Dispatcher allows up to 90 seconds per call specifically to cover a cold start plus a complex render, so an occasional slow first call will not itself cause a timeout error.
Q: Can I use the same App Registration for both Graph API access and the Dispatcher?
A: No. Microsoft Graph access uses REFRACT SharePoint Access (the refract_graph_* variables), and Dispatcher calls use the Dynamics 365 Sales connector app (the refract_dispatcher_* variables). Keeping them apart means the connector holds no SharePoint permissions, and you can revoke or rotate one without touching the other. See Connect a source system.
Q: How long are generated PDFs stored in SharePoint?
A: PDFs remain in SharePoint until manually deleted. Apply your organization's document retention policy using SharePoint retention policies or archive strategies.
Q: What happens if I delete a template that has already been used to generate documents?
A: Existing PDFs in SharePoint and existing refract_documentlink records are not affected. Document links remain readable. The deleted template no longer appears in the gallery, so no new documents can be generated with it. Recreate the template if ongoing document generation is needed.
Q: Can multiple CRM users generate documents from the same record simultaneously?
A: Dynamics 365 does not lock records during document generation - multiple users can trigger the action at the same time. Each invocation creates its own refract_documentlink entry (latest-wins for each link type). For workflows, this may result in multiple workflow instances. Coordinate with users to avoid parallel invocations on the same record.
Q: How do I migrate template configuration between environments (dev to production)?
A: Template configuration is stored in Dataverse tables (refract_template, refract_templatefield, etc.). Export these tables from the source environment using Power Platform Dataflows, Configuration Migration Tool, or a custom export, then import into the target environment. Environment Variables must be set per environment - they are not included in configuration exports.
Q: How do admins access the REFRACT Platform template configuration tables?
A: Template configuration is stored in standard Dataverse custom tables. Access them via Power Apps → select your environment → Tables, then search for refract_. Alternatively, use Advanced Find in Dynamics 365 Sales and search within the refract_template, refract_templatefield, or refract_templateassignment tables. End users interact only with the Command Bar buttons on their standard CRM forms - they do not need access to the refract_ tables directly.
Developer Guide - REFRACT Platform for Dynamics 365 Sales
Technical architecture, detailed action flows, Dataverse table schemas, Custom API and plugin reference, batch dispatch modes, workflow enforcement, and deployment/ALM for the REFRACT Platform CRM integration.
REFRACT Platform Connector for Power Platform
Connect Power Automate and Power Apps to your organization's REFRACT Platform Dispatcher. Generate PDFs, send documents for e-signature and approval workflows, and retrieve sealed documents - without writing code.