Author Archive

Using conditional section merge feature to display different text based on object conditions

Example Use Case:
Is it possibly to display different text based on different related list conditions on Account record? I have different currencies I would like to display depending on what country the specific account is from (GBP or USD).

App expert reply:
You can accomplish this by using conditional section merge feature of A5 Documents.You can check this article, and find out how it can be done:
https://kb.a5documents.com/knowledge-base/conditional-section-merge/

In short, you can create two formula checkbox fields on Account object. One that will return true if currency is GBP and the other one that will return true if currency is USD (or vice versa, as you wish). Then, you would use those formula fields to merge sections in Template Builder on Document Action.

Let’s say that formula fields are called IsGBP and IsUSD. Part of the template in question would look like this:

{!Account.IsGBP[SECTION_START:GBP]}
Bank 1 Details
{!Account.IsGBP[SECTION_END:GBP]}
{!Account.IsUSD[SECTION_START:USD]}
Bank 2 Details
{!Account.IsUSD[SECTION_END:USD]}

There are some additional tips in the article above for conditional merge section for more detail.

Error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY

Error:

CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, rsdoc.DocumentActionTriggers: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object Trigger.rsdoc.DocumentActionTriggers: line X, column 1: []


App expert reply:

You may see this error message when running unit tests. To fix this issue, call A5 Documents onInstall method in your test setup:

rsdoc.PostInstallClass classInstanceName = new rsdoc.PostInstallClass();
classInstanceName.onInstall(null);

Error while creating new document: Not allowed to insert > Document Request record

Error Message:
Error while creating new document. Error message: Not allowed to insert > Document Request record.

App Expert Reply: 
– Check that user has access to Document Request object. Or open sharing settings up for the object by going to Setup > Security Controls > Sharing Settings > Document Request > Change to a Public setting.
-If error persists after you have given user “Read” and “View All” for that object, you  should give them “Create” permissions to the Document Request object to resolve error.

Error: Unable to tunnel through proxy

Full Error Message:
“Unable to tunnel through proxy, Proxy returns “HTTP/1.1 503 Service unavailable”

App support reply:
See if error is consistent or only happens sometimes. The issue could be temporary and resolve itself. If not, then your IP address or domain could be the cause of error. If unable to resolve, please contact support.

Error: Email privileges have been revoked

Full Error:
Your organization’s email privileges have been revoked due to non-compliance with our Terms of Use. Please contact your salesforce.com administrator or <a href=”javascript:openPopupFocusEscapePounds(‘https://login.salesforce.com/services/auth/sso/00D30000000XsfGEAS/HTAuthProvider, ‘Help’, 1024, 768, ‘width=1024,height=768,resizable=yes,toolbar=yes,status=yes,scrollbars=yes,menubar=yes,directories=no,location=yes,dependant=no’, false, false);” title=”submit a case (New Window)”>submit a case</a> to have a salesforce.com representative contact you.

App Support Reply:
This is an error message coming from Salesforce and not from A5 Documents app. You should contact your Salesforce administrator or Salesforce account rep about this email issue as error states, “Your organization’s email privileges have been revoked due to non-compliance with our Terms of Use.” You could also check Email Deliverability settings, as specified in this article and ensure “turned on”: https://help.salesforce.com/articleView?id=000334681&type=1&mode=1.

PDF Merge Feature

If you need to merge additional existing PDFs with your generated document you may do so using this optional feature. If intersted in enabling this feature with your app subscription, please contact support for more detail.

Once A5 Apps support has enabled the custom setting to merge additional PDFs in your org, you can follow the steps below:

  1. There will be following fields available to add to your Document Action page layout:
    1. Merge Additional Documents: This is a checkbox field that you will need to check to merge additional PDFs within related document action.
      • Note that if you check this box and support has not enabled this custom setting in your Salesforce org, you will see an error message when trying to save your document action.
    2. Template Position: Purpose of this picklist field is to decide which position you would like the generated document from google doc template in document action to merge in comparison to rest of PDF merge documents.
      • If you would like the generated document from template to show first in PDF merge, you would select template position “1” in this field.
      • If for example you wanted to merge some cover page or marketing graphic material to show first in PDF merge, you could have the template position field as “2” instead so cover page PDF or marketing graphic would show first in merged document and then generated document second.
      • Note that if you do not populate a template position in this field, app will default the generated document from template to be “1” so it is first in the merged PDF with other attachment(s).
    3. Document Fields 2 through 10: These fields will store the existing PDF File ID that you would like to merge additional existing PDFs in document action. You have the option to merge 1 to 10 additional existing PDFs into document and you would only populate the Document field(s) with File IDs that are needed to merge in document action.
      • To pull existing PDF File ID: Open an existing PDF File record in Salesforce > Click on “View File Details” (see Figure 1 below for visual example) > then copy the Id from the URL address bar.
      • For example, if the URL of existing PDF File is showing as “https://jennatest.lightning.force.com/lightning/r/ContentDocument/0691R00000JyQ38QAF/view” then the File ID you would copy and paste into Document field in document actionwould be 0691R00000JyQ38QAF (see Figure 2 below for visual example).Figure 1: Showing example Image to find “View File Details” from drop down arrow when viewing File.
        Figure 2: Showing example image of the URL of PDF File to pull File ID “0691R00000JyQ38QAF:”
  2. Once you have configured document action with all needed fields populated and have all File IDs, you will save and then paste updated document action code into custom button.
  3. After you generate the document using this feature, you will see all PDFs documents merged into one final PDF and in order that you selected for template position in document action.
    • Note if using document action feature to “attach file to record,” you will see two separate attachments get created: One attachment will have just the generated document merged from template and the second attachment will include the other addiitonal PDF merge attachments.
  4. Contact support with any additional questions or if you need this feature enabled in your org.

Errror: Insufficient permissions: secure query included inaccessible field

You may see this error message when generating a document under a Salesforce user where one or more fields that are being merged in the document are unaccessible to those users which is why they are getting the error. We had to implement this feature to be in regulation of Salesforce security policy so you will need to give all app users proper access to the field(s). For example, the field cannot be hidden from the users generating the document and they need at least “read” field accessibility.

Edit Field Permission(s):
You can go to Setup > find related field under object > then open up security permissions or add permission for each SF user that does not have proper access to it.

Finding the error(s) in template:
If you are not sure which field is returning the error or that user does not have proper access to from template, you can remove most fields except a few from google doc template, test and see if error happens. And isolate the error and update permissions. Or you can create a new test doc action (clone the other one returning this error for limited users) and create a new google doc template, update sharing settings on google doc template and then copy/paste a few fields at a time under restricted user to see which fields returning the error. And then update the permissions of field or for that user.

Image of Error Message:

If you have a developer or tech person that can assist, there is a simple and quick solution to know which fields your users do not have access to:
1. You can make a list of all fields used in your templates (just go through all templates and write down the fields, and that is the most time consuming part).
2. Log in as a user that will use the app to generate documents, and run a script in anonymous that will check for permission for that profile (that is a bit of dev work).
3. Read results from debug log and copy needed info to a document.
4. Repeat steps 2 and 3 for other profiles that will use the app for document generation.
5. That way you will have a list of all profiles you need and all the used fields their permissions for that profile.
Our premium support team can assist you with this as a service if you would like.

Integrate A5 Documents with eSignature Solution

If you are looking to integrate A5 Documents app with an eSignature solution, please see our A5 Signature app for an optional solution for only $5/user/month. 
If you are already using DocuSign to send documents for eSignature and don’t want to switch to our own eSignature app A5 Signature (see a comparison chart here for both eSignature apps), then you can still use A5 Documents with DocuSign:
Steps for DocuSign integration:
1. You can use A5 Documents to generate a PDF and attach it to the record.  Then when you click the button to send a document using DocuSign, you can select the PDF that is attached to the record to send for signature.  Then within the DocuSign UI, just add the location for the signature on the PDF.

2. You can also define placeholders/DocuSign tags in document that are then used by DocuSign: https://support.docusign.com/guides/dfs-admin-guide-automatic-anchor-text-and-tags. You will still create your google doc template with A5 Documents and then you would put the DocuSign placeholder tags in related spots on your template (in white font so they are not visible), (example tags are “\i1\” for initials and “\s1\” for full signature).

3. Then click custom button to generate the document and attach it to the record with output format PDF. Then you can use the Lightning component by DocuSign (drag this component onto your object layout so button is visible) called “Send with DocuSign:”
4. After you clicl “Send with DocuSign” button, on left side, you will see all your related PDF attachments to that specific Salesforce record so you will need to manually “x” out of the documents you do not want to send with your signature document. You can click “Add Recipients” if you have more than one person you would like to send the documents too:
5. Once you have the documents ready you would like to send for signature and recipient(s) populated, click “Next” button on bottom left and then you will see a preview of the generated documents with the DocuSign tags placed over the PDF for the recipient to place their initials/signature. Once you have placed and moved around all placeholder tags on your signature document, click the yellow “Send” button in top right to send to your recipient(s):
6. Then you will be able to access your eSign document under the “DocuSign Envelopes” related object. This standard functionality process would require the click of two separate buttons (one with A5 Documents and one with DocuSign) though if you would like to discuss this process improvement more or want help developing a custom solution, we offer premium app support at $125/hour.
If you are looking for a one click solution to generate and send for signature then consider using our other A5 Signature with A5 Documents. Cost for A5 Signature app is same price as A5 Documents which is only $5/user/month. You can view a feature/pricing comparison chart for A5 Signature verse DocuSign here: http://a5documents.com//docusigncomparisonchart/.

Merge a checkbox image into my template

Example Use Case:
I have checkbox field on my Salesforce record that is either marked True or False. Rather than merging the value of the field as True or False on my generated document, I would like to merge the actual checkbox image showing as checked or unchecked. How can I do that?

App Expert Reply:
You can conditionally merge images based on the checkbox values. You should create two images: 1st with the checkbox checked, 2nd checkbox unchecked, and then have a formula field that display either 1st or 2nd image depending if the actual checkbox is checked in Salesforce or not. You can review this conditional merge section article for more detail on this feature as well as this article for how to create and merge images onto your template.

Merge the name of the current Salesforce user that is generating the document into template

Example Use Case:
I would like to merge the first and last name of the Salesforce user that is currently generating the document into the template. How can I build this?

App Expert Reply:
You create a formula field on the object you are merging from. For this example,  lets use Opportunity object.  When you create the formula field you can call it “User Full Name” and when you build the formula, you can insert a field to merge into that formula field.  When you go to advance and insert field you can select to merge from current User.  Starts with $User and would look something like $User.First Name.  After creating the field on the Opportunity you can view it on the page layout and see that it will just display who ever the current user is logged into salesforce at anytime.  And so then merge this new formula field you created into the template.