Author Archive

Error Message: Error: 401. “Request is missing required authentication credential.”

Full Error Message:
Error while creating new document. Error message: Error: 401. Error description: { “error”: { “code”: 401, “message”: “Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.”,”status”: “UNAUTHENTICATED” } }

-You may get this error message when trying to generate a document though your google drive has not  been connected and app unauthorized. Or it needs to be reconnected after package install update or major change in RS Documents process.

How to resolve:
-First you need to make sure this user is an assigned app user by following our activation instructions.
-Second, you want to decide if you would like each app user to authorize their own drive or if you would like only one Salesforce user to authorize the app and the google drive for ALL app users to generate documents too. See this article for more detail on this optional feature.
-If you would like each user to authorize the app and their own drive, each user will need to go to “RS Documents Configuration” tab and click “Grant access.” Then you will follow the steps to connect your google drive account you would like to use to generate documents. You can click here if you need to create a new gmail/google account.

My colleague who configured the app is leaving company, how do I make for a smooth transition for document generation?

We suggest to test under the new user prior to original app user leaving if possible. This will make for a smoother transition between users and google drive settings:
1. Open up current google doc templates that are being used in active document actions (can access by click on the “here” button from above the embedded template builder within document action or find the template directly on your company drive if applicable).
2. Notice the sharing/permission sets on original google doc templates made by colleague if you would like to keep it the same with new template (keep original template IDs copied on clipboard or place in folder on computer or google drive).
3. Go to “File” and then “Make a Copy” of each of your google doc template and save it to the new users google drive so that they become the owner of the new google doc templates.
4. Replace the current template IDs with the new IDs in each related document action. inOnce you have the new templates copied to your google drive,
5. Go to RS Documents Configuration tab to authorize app and google drive to be used with new user and new template IDs already in document action(s) and make sure your user is an active assigned user to the app following end of our activation instructions).
6. Then test document generation under new user. If you find an error message, do a search in our Knowledge Base to see if you can find related error article. If you are unable to find and not sure what issue is, submit a case to support with more detail and provide login access to Ramsey Solutions.
7. Have new user review any needed support articles for more detail on setup and instruction (begin with “Getting Started” section).

Use Case: Can I merge an image into header of each related list table?

Consulting Reply:
You can “insert” a header or footer into document and can merge fields and images there. You can also insert an image merge field into top of table though we don’t think there is a way to make the table header repeat on each page as the related list repeats.  One thing we can try to figure as possible option is allowing the page to break and controlling that and merging other tables filtering on the quote line items.  Such as maybe calculating the characters or lines in the description field and using that to try to group the line items into pages and merging them in groups for each page.  There may be something else in Google docs functionality to try to just get it to repeat a header for the table on each page.

I am using “download file” feature in RS Documents but do not see the document go to my Downloads folder on computer. What am I doing wrong?

It is mandatory that you allow Pop Ups from Salesforce domain as browsers are interpreting this “download” action as a popup in new window. If you are’t sure if your pop ups are already approved, you will notice that when you attempt to generate a document for download to your computer, there is usually an indication that a pop up was blocked and you have the option to approve that URL for the future. Once the URL is approved, you should not have to do this step again.

To check your pop-up settings in Chrome Browser: chrome://settings/content/popups?search=pop. You will want to make sure you allow Pop Ups from Salesforce and/or RS Documents domain.

Use Case: Does RS Documents have the ability to group items in a related list based on the value of a specifiable field when generating document?

Full Use Case:
I have 4 records on a related list and I print them to a document:

Record 1
Record 2
Record 3
Record 4

But let’s say there is a field on each record called Team with two values, “Team A” and “Team B”. If Records 1 and 2 have “Team A” in this field and Records 3 and 4 have “Team B” in this field, would it be possible to group these records by this field so the output to the document would look like:

Team A
Record 1
Record 2
Team B
Record 3
Record 4

Thereby the records are all group by the value of a specific field. How can I configure this use case?

Consulting  Reply:
You can split the merge of the related lists with a filter on the group. You can also develop a sorting of the related list to sort by the group. If you need assistance with configuring this, we have a team of consultants at Ramsey Solutions if you would like to be connected.

I am using “download” feature in document action and do not see a preview of document after I generate, how does this feature work?

The “download” app feature is not meant to open up a preview of the document automatically after you generate document (screen flashes to let you know a download happened but it does not auto open document in another window). The download feature is only to download a copy of the document to your computer, which would show in your “downloads” folder. So you would need to open your downloads folder on computer in order to see it. The only way to bypass this step is you have another setting on your browser to automatically open the download document or using “Preview” program on a MAC to auto open downloads or can configure Chrome browser by inserting the ‘rs doc link’ in the ‘allow pop-ups’ page.

Another option is to access the document within Salesforce by using document action is to “attach file to record” which you could then access the document under Notes & Attachments or maybe files if you using files instead. Or you can use the “save URL link to Salesforce” feature and have a URL link to google doc right there from same window (users would need to have access to open link by your sharing settings in document action and access to your google drive that documents are stored on AND you would not be able to use app feature to “delete google doc after merge” in document action). Or you could configure email feature in document action to then send generated document to an email outside of Salesforce.

Use Case: What is an example process that could be setup using batch mode?

Example use case using Batch Mode/Document Request Object and customer goal is to generate 2,000+ receipts: 

  1. Could setup a Process Builder under Contact object that when box is checked on Contact record (example checkbox could be “Send Receipt”), this will trigger the Process Builder automation that creates new Document Request record. The document request record is a link between Document Action and your record (Contact in this example).
  2. Process Builder automation then creates new Document Request record. The document request record is a link between Document Action and your record (Contact in this example).
  3. Scheduled RS Document batch job runs on the background every 4-6 minutes and is looking for any Document Requests with the Status = New. Then it executes the Document Action for these requests, generates Documents and marks the status to “Completed”.
  4. The Scheduled Batch Job can only process 20 records at a time. Then it waits another 4-6 minutes to process next 20 records in the queue.
  5. Currently, the RS Document process keeps processing all the Document Requests that were created and are in status “New” (and with this example would need to go through several batches to create receipts from  2,000+ records). In order to process to the next batch of Document Requests, batch mode needs to complete all the previous Requests that are in the queue.

I do not see the Google Doc Advanced Sharing setting “Anyone with the link,” why is that?

If you do not see the “Anyone with the link” as an option for sharing/permission settings on your Google doc, then you have some strict sharing settings setup on your company Google Drive and the Super Admin of your drive will need to alter the settings to be able to generate documents with app, see steps below in this article:

  1. You can review this article to know how to check all Super Admin settings to share templates outside of your company: https://support.google.com/a/answer/60781?hl=en. Select drop down for “Let Users Share with Anyone” and make sure your drive settings match this. The goal is to be able to share your google doc template/folder OUTSIDE of your company since this is a requirement to process documents with RS Documents app (since our google script/user is not within your company).
  2. Important setting: “Allow External Users to Preview File without Google Sign in.” This should be the correct setting and NOT “Require Sign-In for external Users to view file.”
  3. Another important setting: “Allow users in [Organization]. to publish files on the web or make them visible to the world as public or unlisted files

I cannot figure out why I am getting an error message or where it is coming from, what is best way to troubleshoot?

If you are merging a child object or related list item, you need to make sure field is merged inside a table so the rows repeat themselves. Review this article for more detail if needed. If you already did this and not sure why you are getting an error message and/or where it is coming from within your template, here are some helpful steps:

  1. It is best to find out which merge field is causing the error message and then you can better figure out how to resolve it.
  2. The best way to troubleshoot is by creating a blank new google doc (do not clone the other template), give it a simple non merge field title and update sharing settings. Make sure to use the same google doc sharing settings, same google drive, and same Salesforce user when testing with this new template.  Then with this new blank google doc, replace this ID in document action and then test document generation to make sure no error message.
  3. Then copy/paste one section at a time into your new template from the old template. After adding each section, test document generation to see if error happens or not. Once you get error message and know from which section or table, then you can try to isolate which error message out of that section is causing it.
  4. If you complete copying section by section of new template and you did not get an error message then there may have been some hidden formatting in that old template (this can happen if you upload google doc template from an existing word doc) and it should now be resolved.
  5. If you need more help to troubleshoot, you can purchase some support time and we will help you resolve. If we find it was an issue with our app or documentation, we will refund the money back to you.

Use Case: I would like to apply conditional coding and logic to generate different versions of the same template depending on SF record, can I use If/Then statements to do this?

Use Case:
Conditional Coding:  We will have some templates that will have different versions of.  For example, we have a template that contains 2 versions, a “lease” version and a “loan” version.  The idea would be to merge this document into one template but use conditional coding and logic to populate the appropriate details (ex. On the mentioned template there may be a field that should say “Loan Agreement” if the product is a loan but would then say “Lease Agreement” if the product is a lease).  In my past experience I have used “If / Then” coding to do this.  Does RS Documents allow for this?  

Consulting Reply:
Yes you can create a conditional merge section on a template.  You basically create a formula field that is a checkbox that can check the box on one condition or leave unchecked if another condition.  Then in the template builder you select this field and indicate to use it as a conditional merge section and you put this merge code in the beginning of the section and end of the section.

The other option around this type of concept is to create a formula that can provide lets say the title of the agreement and in the formula field you would have what ever logic you need to display “Loan Agreement” or “Lease Agreement”.  This could be good strategy if only a few things that are different.  Otherwise using conditional merge sections can make more sense when more differences.  Another option is having two templates.  And your button code you click to merge the document can have an if statement in the button code to decide which Document Action to use for the document based on some field value.