3.9 KiB
3.9 KiB
Deploying Flow and APEX Code to Salesforce Production
This guide provides step-by-step instructions for moving your Flow and APEX code from a sandbox to a Salesforce production organization using Salesforce's built-in tools (no local source code required).
Prerequisites
- You have access to both the sandbox and production Salesforce orgs.
- You have System Administrator permissions in both orgs.
- The Flow and APEX code are already deployed and tested in the sandbox.
1. Use Change Sets to Deploy Metadata
A. Create an Outbound Change Set in Sandbox
- Login to your Sandbox.
- Go to Setup > Change Sets > Outbound Change Sets.
- Click New to create a new change set (e.g., "Docusign Composite Envelope Builder").
- Add a description for clarity.
- Click Save.
B. Add Components to the Change Set
- In the change set, click Add under "Change Set Components".
- Add the Flow(s):
- Component Type:
Flow DefinitionorFlow. - Select the active Flow version for the application. For this repository the Flow to include is
Docusign_Envelope_Templates_V4.
- Component Type:
- Add APEX Classes:
- Component Type:
Apex Class. - Include the following Apex classes from the package:
DocusignCompositeEnvelopeBuilderDocusignEnvelopeRequestDocusignEnvelopeRequestHandlerDocusignEnvelopeResult
- Also include associated test classes:
DocusignCompositeEnvelopeBuilderTestDocusignEnvelopeRequestHandlerTest
- Component Type:
- Apex Triggers:
- This package does not include any Apex Triggers. There are no trigger files in
force-app/main/default/triggersto add to the change set.
- This package does not include any Apex Triggers. There are no trigger files in
- Custom Objects / Fields:
- There are no custom objects or custom fields that must be deployed for the current implementation. The repository does contain a
Docusign_Configuration__cobject (withAccount_Id__candBase_URL__c) inforce-app/main/default/objects, but it is not referenced by the APEX classes or the Flow (the implementation uses thedfsletoolkit anddfsle__EnvelopeConfiguration__ctemplates). You do not need to includeDocusign_Configuration__cor its fields in the change set unless you intentionally want to preserve that leftover metadata.
- There are no custom objects or custom fields that must be deployed for the current implementation. The repository does contain a
- Click Add to Change Set after each selection.
C. Add Profiles/Permission Sets (Optional)
- If your app uses custom permissions, add the relevant profiles or permission sets.
D. Upload the Change Set to Production
- In the change set, click Upload.
- Select your production org as the target.
- Click Upload.
2. Deploy the Change Set in Production
A. Login to Production
- Login to your Production Salesforce org.
- Go to Setup > Change Sets > Inbound Change Sets.
B. Validate and Deploy
- Find the uploaded change set.
- Click the change set name to review components.
- Click Validate to run tests and check for errors.
- If validation passes, click Deploy.
- Monitor deployment status and resolve any errors if needed.
3. Post-Deployment Steps
- Assign Permission Sets/Profiles to users as needed.
- Test the Flow and APEX functionality in production.
- Review Custom Settings/Metadata for environment-specific values (e.g., API keys, URLs).
Troubleshooting
- If deployment fails, review error messages for missing dependencies or test failures.
- Ensure all referenced components (objects, fields, flows, classes) are included in the change set.
- For large or complex deployments, consider deploying in smaller batches.
References
- Salesforce Change Sets Documentation
- Deploy Flows with Change Sets
- Deploy Apex Code with Change Sets
Contact your Salesforce administrator or partner for additional support if needed.