REFRACT Platform for Dynamics 365 Sales

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:

  1. Do Command Bar buttons appear on CRM records?

  2. Does clicking a button return an access error?

  3. Does the Template Gallery open but show no templates?

  4. Does document generation fail?

  5. Is workflow enforcement blocking CRM operations unexpectedly?


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

  1. Open Power Platform Admin Center
  2. Select the target environment → Solutions
  3. 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

  1. Close all Dynamics 365 tabs
  2. Open a new tab and navigate to Dynamics 365
  3. Open a Quote or Opportunity record
  4. 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:

  1. Open Power Apps (make.powerapps.com)
  2. Select Apps → find and open the model-driven app your sales team uses (e.g. Sales Hub)
  3. Click Edit → navigate to the relevant entity form (Quote, Opportunity, etc.)
  4. 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

  1. In Dynamics 365, navigate to Settings → Security → Users
  2. Open the affected user's record
  3. Click Manage Roles
  4. 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

  1. Navigate to Settings → Security → Security Roles
  2. Confirm REFRACT User appears in the list
  3. 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.


No templates are assigned to the current entity, or all templates are inactive.

Confirm Templates Exist

  1. Open Power Apps, select your environment, and navigate to Tables. Search for refract_template
  2. Navigate to Templates
  3. If the list is empty, create at least one template. See the main setup guide for steps.

Check Template Is Active

  1. In the Templates list, confirm Is Active is Yes for the relevant template
  2. Inactive templates are excluded from the gallery even if assigned

Verify Template Assignment

  1. In Power Apps → Tables, open refract_templateassignment
  2. 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

  1. On the Template Assignment record, confirm Context is set to form, view, or both
  2. If Context = view and the user is on a record form, the template does not appear
  3. Adjust the context to both to 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

  1. In Power Platform Admin Center, open the environment → Solutions → REFRACT Platform for D365 Sales → Environment variables
  2. Confirm all five Dispatcher variables are populated:
    • refract_dispatcher_baseurl
    • refract_dispatcher_tenantid
    • refract_dispatcher_clientid
    • refract_dispatcher_clientsecret
    • refract_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

  1. In Azure Portal, open App Registrations → the Dynamics 365 Sales connector app
  2. Click Certificates & Secrets
  3. Check the Expires date on the secret in use
  4. If expired, click New client secret - set expiry to 24 months and copy the Value
  5. Update refract_dispatcher_clientsecret in 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

  1. Confirm all four Graph variables are populated:
    • refract_graph_tenantid
    • refract_graph_clientid
    • refract_graph_clientsecret
    • refract_graph_driveid

An expired refract_graph_clientsecret or incorrect refract_graph_driveid causes 403 errors.

Check Azure AD App Permissions

  1. In Azure Portal, open App Registrations → REFRACT SharePoint Access
  2. Click API permissions
  3. Confirm Sites.ReadWrite.All is listed with status Granted for your tenant

If status shows "Needs admin consent":

  1. Click Grant admin consent for [your tenant]
  2. Confirm in the dialog

Verify the Drive ID

  1. Use Microsoft Graph Explorer
  2. Authenticate with your Azure AD account
  3. Run: GET /sites/{siteId}/drives
  4. Find the drive for your output document library and copy its id
  5. Update refract_graph_driveid with 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

  1. In Power Apps → Tables, open refract_template and find the relevant template
  2. Check the Template Variant ID field - this must match the exact filename/path used in the REFRACT template library
  3. 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

  1. Open the blocked CRM record
  2. Click [Sync Workflow Status] in the Command Bar
  3. 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

  1. In Power Apps → Tables, open refract_template
  2. Find the template used to generate the document on this record
  3. Check Workflow Enforcement Mode:
    • Block - CRM operation is prevented with an error until workflow is complete
    • Validate - Also prevented with an error. A Dataverse pre-operation plugin cannot show a dismissible warning and then let the save continue, so Validate behaves the same as Block today
    • None - 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.

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

  1. In Power Apps → Tables, open refract_templaterecipient
  2. Confirm at least one recipient has Recipient Type = Workflow and a valid email address
  3. 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.

  1. Verify refract_dispatcher_baseurl is set correctly in Environment Variables
  2. Confirm the Dispatcher Function App is running in Azure Portal
  3. 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

  1. In Dynamics 365, navigate to Settings → Administration → System Settings
  2. On the Customization tab, set Enable logging to plug-in trace log to All
  3. Retry the failing action
  4. 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

ErrorCauseResolution
NullReferenceException on refract_graph_driveidEnvironment variable is emptyPopulate refract_graph_driveid
HTTP 401 from DispatcherDispatcher credentials expired or incorrectRotate refract_dispatcher_clientsecret
HTTP 403 from Graph APIGraph App Registration lacks admin consentGrant admin consent for Sites.ReadWrite.All
No refract_templateassignment foundTemplate not assigned to this entityCreate a Template Assignment for the entity
refract_documentlink not foundOpen Document or Sync Status called before Process DocumentRun 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:

  1. Export your template configuration as a Dataverse export or use Power Platform Dataflows
  2. Document your Environment Variable values (except secrets)
  3. 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.

On this page

Quick DiagnosticsCommand Bar Buttons Not VisibleSymptom: "No REFRACT buttons appear on Quote, Opportunity, or Account records"Verify the Managed Solution Is InstalledHard Refresh the BrowserVerify Command Bar in App DesignerSecurity Role IssuesSymptom: "Access denied" when clicking a Command Bar buttonAssign the REFRACT User Security RoleVerify the Role ExistsSign Out and Sign Back InTemplate Gallery Is EmptySymptom: "The Template Gallery shows no templates when [Process Document] is clicked"Confirm Templates ExistCheck Template Is ActiveVerify Template AssignmentCheck Context SettingDocument Generation FailuresSymptom: "An error occurred while calling the Dispatcher" after clicking GenerateVerify Dispatcher Environment VariablesRotate the Dispatcher Client SecretTest Dispatcher ReachabilitySymptom: "SharePoint upload failed with 403 Forbidden"Verify Graph Environment VariablesCheck Azure AD App PermissionsVerify the Drive IDSymptom: "Template not found" error from the DispatcherVerify Template Variant IDVerify SharePoint Template Library AccessWorkflow Enforcement IssuesSymptom: "Operation blocked by REFRACT Platform" when activating a Quote or closing an OpportunitySync the Workflow StatusCheck Enforcement Mode on the TemplateClear a Stale Workflow LinkWorkflow Status IssuesSymptom: "Sync Workflow Status shows 'Workflow not found'"Verify the Workflow Was TriggeredCheck for Workflow ExpirySymptom: "Workflow recipients do not receive invitations"Verify Recipient ConfigurationCheck Dispatcher Workflow LogsNo List-View or Multi-Record Processing"I selected multiple records in a list view and clicked Process Document, and nothing happened"Performance and Timeout IssuesSymptom: "Process Document hangs for over 30 seconds before failing"Check for a Missing or Misconfigured Dispatcher URLCheck SharePoint Upload PerformanceSymptom: "User sees a spinner while Process Document is running"Plugin and Solution IssuesSymptom: Plugin errors appear in Dataverse Plugin Trace LogsEnable Plugin Trace LoggingCommon Plugin ErrorsSymptom: Managed solution upgrade fails or causes data lossAlways Use Managed Solution Imports for UpgradesBack Up Configuration Before UpgradingCommon Questions (FAQ)Q: Can REFRACT Platform for Dynamics 365 Sales be used without Business Central?Q: Can I add REFRACT Platform to custom entities or entities not in the initial list?Q: Should I expect a cold-start delay on the first "Process Document" of the day?Q: Can I use the same App Registration for both Graph API access and the Dispatcher?Q: How long are generated PDFs stored in SharePoint?Q: What happens if I delete a template that has already been used to generate documents?Q: Can multiple CRM users generate documents from the same record simultaneously?Q: How do I migrate template configuration between environments (dev to production)?Q: How do admins access the REFRACT Platform template configuration tables?