Using SharinPix deeplink to launch a PDF from Salesforce mobile
Requirements
For such implementation, please ensure that you have a PDF document which:
- Does not consist of features that require being online
- Utilizes either embedded fonts or the following standard fonts: Courier, Courier-Bold, Courier-BoldOblique, Courier-Oblique, Helvetica, Helvetica-Bold, Helvetica-BoldOblique, Helvetica-Oblique, Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic, Symbol, ZapfDingbats.
Configure the SharinPix deeplink to launch the PDF
Pre-requirement:
Prior to configuring the deeplink, you should ensure that a SharinPix token is available for the record on which you intend to upload the PDF.
You can refer to the following article to set up an automation that will generate a SharinPix token upon creation of records if required:
To launch a PDF from the Salesforce mobile app using SharinPix, the pdf parameter should be configured in the SharinPix deeplink.
The general form of such deeplink is as follows:
sharinpix://upload?token=<Your Token>&pdf=<Your Encoded PDF URL>
As indicated above, the pdf parameter takes as value an encoded version of the PDF URL. For example, if your PDF URL is https://pdf.test.com/smart_solar.pdf, here is the encoded version to be used as the value for the pdf parameter: https%3A%2F%2Fpdf.test.com%2Fsmart_solar.pdf
Here is an example of the full deeplink:
sharinpix://upload?token=<Your Token>&pdf=https%3A%2F%2Fpdf.test.com%2Fsmart_solar.pdf
The Prefill Option
The prefill option is used to prefill the PDF text boxes. To enable this option, the parameter pv should be added, followed by the text box name. This parameter should store the encoded prefill value as shown below:
pvTextboxName=<Your Encoded Prefill Value>
The example below demonstrates a deeplink using the pdf parameter along with the prefill option:
sharinpix://upload?token=<Your Token>&pdf=<Your Encoded PDF URL>&pvSurname=John%20Doe
Enable and display the PDF values
The PDF values can be displayed on the SharinPix Image record corresponding to the submitted PDF as demonstrated below:
Note:
- For the time being, values are only saved in fields containing text values (
'STRING', 'TEXTAREA', 'PICKLIST', 'MULTIPICKLIST', 'PHONE', 'URL'
) - For the above configuration:
- The SharinPix Image Sync feature should be enabled for the object on which you are uploading the PDF. For more information on how to enable the Image Sync on an object, refer to this article: Setup SharinPix Image Sync
- A Webhook of type Upload Done or New Image should be configured for your organization. For more information on how to configure SharinPix Webhooks, refer to this link: http://docs.sharinpix.com/m/documentation/l/990066-image-sync-for-pictures-uploaded-via-sharinpix-mobile-app#how-to-configure-it--1
To enable and display the PDF values, follow the steps below:
- From Setup, search for Custom Metadata Types
- Click on Manage Records next to SharinPix Bypass
- Then, click on the Edit button corresponding to the PdfValuesEnabled entry
- On the SharinPix Bypass Edit page, check the Active checkbox
- Next, go to the Object Manager tab and search for the SharinPix Image object
- Go to the Page Layouts section and click on SharinPix Image Layout
- Add the PDF Values field to the page layout:
Now that the PdfValuesEnabled option has been enabled, and the PDF values field added to the SharinPix Image object's page layout, after submitting PDF from the SharinPix mobile app, all the PDF values will be synced on the related SharinPix Image record. These values will be stored in a JSON format in the PdfValues__c field:
If the PDF contains field names corresponding to the SharinPix Image object's field API names within Salesforce, the fields are automatically filled with the value entered on the PDF as demonstrated below:
On PDF:
Corresponding field on Salesforce, (FieldName__c in our case) is automatically populated with the value entered on the PDF:
Tips:
- You can make use of this handy tool to encode the PDF URL: https://www.urlencoder.org/
- The SharinPix to PDF deeplink can also be used in Field Service App Extensions and Field Service Mobile Flows.