For the complete documentation index, see llms.txt. This page is also available as Markdown.

How To: View Document Versions in the Documents LWC

The View Document Versions feature in the Documents (S-Docs) Lightning Web Component allows users to view and manage version history for generated documents directly from a Lightning record page.

Each time a document is refreshed or updated using supported actions, S-Docs automatically creates a new version of the document while preserving earlier versions for reference, comparison, and audit purposes.


Enabling Document Versioning

To allow users to view document version history, versioning must be enabled in the component configuration.

To enable document versions:

  1. Open Lightning App Builder.

  2. Edit the record page.

  3. Select the Documents (S-Docs) component.

  4. Enable Show Versions.

  5. Click Save and activate the page.

Once enabled, users will see a Versions option next to generated documents in the Documents LWC.


How Document Versions Are Created

Document versions are automatically created when:

  • A document’s data is refreshed using Refresh Data

  • A document is updated using the Live Edit feature (if enabled)

Each version represents a snapshot of the document at that point in time.


Viewing Document Versions

Once versioning is enabled, users can view previous versions directly from the record page.

To view document versions:

  1. Navigate to the record page.

  2. Locate the document in the Documents (S-Docs) component.

  3. Click the Versions option for the document.

  4. A list of available versions is displayed on a pop up screen.

  5. Select a version to view or download it.

The most recent version is shown as the active version by default.


Benefits of Document Versioning

Viewing document versions allows users to:

  • Track changes made to documents over time

  • Compare previous and updated document content

  • Restore or reference earlier versions if needed

  • Maintain an audit trail for compliance and approvals

Considerations

  • Document versions are only visible when Show Versions is enabled.

  • New versions are created by Refresh Data and Live Edit actions.

  • Versioning does not apply to HTML email templates.

  • Runtime Prompts and Job Splitters are not compatible with document versioning.

  • Version history is associated with the same Salesforce record.


For optimal usage:

  • Enable Show Versions alongside Show Refresh

  • Place the Documents (S-Docs) LWC below the Generate Documents (S-Docs) LWC

  • Enable versioning for records where document accuracy and traceability are important

This configuration allows users to generate, update, review, and track documents efficiently without leaving the record page.

Last updated

Was this helpful?