Now that licenses and permissions are managed on Salesforce, we can discuss settings in the "Maven Documents" application.
In the App Launcher on Salesforce, find and open Maven Documents. There, you'll find the "Setup Assistant" tab, which contains all the settings you need to work with the application.
The tab is visible only for users with the "Maven Documents Administrator" permission set assigned.
To try out Maven Documents and see how it works with DOCX and XLSX templates, you must have a valid Microsoft user account with an appropriate email address. Please send your Microsoft account email to contact@mavenmule.com and we will provide you with a temporary subscription ID. You need to enter it in the Maven Headless Settings during the setup process.
The tab is divided into 3 sections:
Sections are collapsed by default, but once you click on them, the content of the section becomes visible.
Let's begin with configuring the "Maven Headless" settings. These settings build a connection with the Maven Headless backend service, allowing you to work with Word and Excel templates.
Enter the Subscription ID. You provide this value to prove the Azure subscription. The subscription is vital for Maven Documents to function if you work with Word or Excel templates.
You get the Subscription ID from Maven Mule. Contact your administrators to determine the required value.
a. Click the "Open Application Settings" button. The "Application Settings" page from the respective "Custom Metadata Types" section is open in the new browser tab.
b. Click Edit. The content of the fields on the page becomes editable.
c. In the "AMP Subscription Id" field, enter the needed value.
d. Save changes and close the tab.
The tab with Headless Settings is refreshed and the green message pops up saying that all went successfully. At the same time, the icon next to the setting gets marked and turns green. The icon next to the section header is partially encircled with blue.
After the step is finished, you can go to Salesforce Setup and check the list of Maven Documents' permission sets. The "Maven Documents Extended" permission set is created and assigned to the user.
Grant Access. With this procedure, you are allowing the "Maven Headless" application to interact with your Salesforce org.
a. Click the "Grant Access" button.
b. Click "Allow".
Install the "Headless Connected App". After you've granted access in the previous step, you can install and set the "Maven Headless" application.
a. Click the "Open Salesforce Setup" button. The "Connected Apps" settings page is open in the new browser tab.
b. Click Install and confirm the choice by clicking Install one more time on the dialogue screen.
c. In the opened "Connected App Detail" settings, click Edit Policies and change the value in the "Permitted Users" field to "Admin approved users are pre-authorized".
d. Save changes and close the browser tab.
Create Named Credentials. With this step, you are creating the opportunity for Maven Documents to do callouts to the "Maven Headless" app.
a. Click the "Create Named Credentials" button.
b. Wait for the app to create credentials in the background.
Enable Callouts. This step enables Maven Documents to do callouts to the "Maven Headless" app.
a. Click the "Open Named Credentials" button. The "Named Credentials" settings page is open in the new browser tab.
b. Click Edit and switch on the "Enable for Callouts" toggle.
c. Add the mmdoc namespace in the "Allowed Namespaces for Callouts" field.
d. Save changes and close the browser tab.
If you are installing Maven Documents into the Org that already has an application with Maven Headless configured, then in Named Credentials you just need to add the "Maven Documents" application namespace alongside the existing one and separate it with a comma.
Once you enable Named Credentials for callouts, you'll need to authenticate your Microsoft account.
There are two ways of authentication possible on Salesforce:
Named Principal
.Per User Principal
.The Named Principal authentication enables the admin to authenticate with the "service account" credentials. In that way, it enables all the users to use the same account when accessing Maven Documents functionalities.
In Salesforce Setup, go to Named Credentials and select the "External Credentials" tab.
Open the "Maven Headless" credentials.
In the "Principals" section, click the dropdown arrow in the "Action" column next to Maven Service Principal and select Authenticate.
The "Per User Principal" authentication enables each user to use their credentials when accessing Maven Documents. The "Per User Principal" authentication is administered on the "User Settings" page.
Click on your profile avatar and select Settings.
In the "External Credentials" section, click Allow Access in the "Maven Headless" bar.
Enter your Microsoft Credentials and then confirm external access.
After the steps are completed, the access is allowed.
Enter the service account credentials and finish the authentication.
When you authenticate Named Principal, you can still have individual users authenticate with their credentials.
Salesforce checks Principals in ascending Sequence Number order and uses the first that is authenticated. In this way, users utilize their credentials.
You can use the common account for all the users or have a combination of these two.
With all the steps from above accomplished, Maven Headless is set and ready for work.
Maven Documents allows you to connect Google Docs or Google Sheets with Document Templates that you use to generate your documents. To have access to the documents from your Google Drive, you need to sign in to your Google Account first.
To successfully connect the account, the user who performs authorization should have either ModifyAllData or ModifyMetadata permissions in Salesforce.
Follow the steps below to authorize the account:
Open Maven Documents.
Select the "Setup Assistant" tab.
Expand the "Authorize Google Account" section.
When the section's content is shown, click the "Sign in with Google" button.
Select the needed account.
Choose what parts of your Google data Maven Documents can access.
Mark needed checkboxes or use the "Select all" option and click Continue.
Be aware that Maven Documents needs these permissions to deliver its capabilities. If permissions are not given, some core features might not work as expected. Give the app all the requested permissions to make sure that you'll get all of the app's capabilities.
Once you finish the steps, you will receive the following message if your account has been connected successfully:
The page with Setup Assistant is refreshed and the icon next to the section name is marked and painted green. The same thing happened to the icon next to the corresponding setting inside the section.
The "Sign in with Google" button in the section is changed to Revoke Google Permissions.
If you have access to some particular data and didn't mark all the checkboxes in the granting access step, you'll also get a message, warning you, that in that case, the generation of Google templates can work with some issues.
Now, Maven Documents is connected to the Google Drive associated with the account you authorized. You can use documents stored on that Google Drive for Document Templates in Maven Documents. Find more detailed information about that here.
Maven Documents uses the authorized account to access the Google Docs template and generate new documents. All Google templates created by Maven Documents are initially owned by this Google account.
You can connect only one Google account to the existing Salesforce Org. If there are different users connected to the Org and they want to use their Google Drive, one needs to revoke access and connect his Google account
If you wish at any time to revoke access to the Google account from Maven Documents, you can simply click Revoke Access in the corresponding section on the "Setup Assistant" tab.
This section provides the configuration of certain parts of the application. Some settings here are set to default values so icons next to them are marked and green. You can find values by clicking the respective buttons.
Maven Documents allows you to generate a large number of documents using Apex Batch. Apex Batch in Salesforce is used to run large jobs that would exceed normal processing limits. Using Apex Batch, we can process records asynchronously to stay within platform limits.
Click the "Edit Batch Settings" button to see what batch parameters are available:
At the bottom of the card you can see the following buttons:
Here's how to change default parameters:
Now, when you go back to Setup Assistant and refresh the page, Batch Settings will have new values.
This setting allows you to select a user who receives a notification email from Salesforce if limits on Document Requests are reached. This setting doesn't have any default value, so it's on you to provide one.
The defined user has to be active. You can't select more than one user in that field.
Every document generated with Maven Documents creates a new Document Request and Action Request record. These records store information required to generate the document and complete the respective post-generation action.
As you will be generating documents, there could be quite a lot of records in the Document and Action Request objects. You can easily delete old requests, either manually or by setting up the automatic deletion process.
The "Deletion of old Document/Action Requests" setting is right there to help you. Here are the options you have:
To change the default number of days, follow the steps:
Now, when you go back to Setup Assistant and refresh the page, the "Deletion of old Document/Action Requests" setting will have a new value.
Keep in mind, that you can't delete Document Requests created in the current GMT month. So when you click Delete Now with some selected number of days only Document Requests from the past months are removed.