> ## Documentation Index
> Fetch the complete documentation index at: https://support.fieldko.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Visit Summary PDFs

> Set up, time, and regenerate the Portable Document Format (PDF) summary of each completed visit, and find out why photos or answers are missing.

FieldKo can create a Portable Document Format (PDF) summary of each completed visit, save it in Salesforce, and email it. Use this page to set the summary up, understand when it's created and what it contains, regenerate one, and work out whether a problem is in the visit's data or in the PDF.

## User Permissions Needed

| To do this | You need |
| - | - |
| Schedule the PDF job | Author Apex, to run code in Execute Anonymous |
| Edit the **Visit Configurations** and **Order PDF Setting** custom settings | Customize Application |
| Regenerate a PDF | Edit access to the visit and to its **Is pdf generated** field |

## Set Up Visit Summary PDFs

**1. Create the Email Template**

Create an email template with the developer name `Visit_Summary_Template`. FieldKo uses it for every visit summary email.

**2. Optional: Add Your Logo**

Upload your logo as a Salesforce document. Then, in the **Order PDF Setting** custom setting, edit the **PDF** record, and enter the document's unique name in **Logo**.

**3. Optional: Limit Which Visits Get PDFs**

In the **Visit Configurations** custom setting, set **Summary PDF Start Date** and **Summary PDF End Date**. Only visits whose **Actual End** falls between the 2 dates get PDFs. Set both dates.

**4. Schedule the Job**

In the Developer Console, open **Execute Anonymous**, and run one of these lines.

| To Run It | Run |
| - | - |
| Every 5 minutes | `new ArxxusRFMv1.VisitSummaryPdfSchedular().scheduleEvery5Mins();` |
| Every 15 minutes | `new ArxxusRFMv1.VisitSummaryPdfSchedular().scheduleEvery15Mins();` |
| Every 30 minutes | `new ArxxusRFMv1.VisitSummaryPdfSchedular().scheduleEvery30Mins();` |
| Every hour | `new ArxxusRFMv1.VisitSummaryPdfSchedular().scheduleEveryHr();` |

`ArxxusRFMv1` is the FieldKo package's namespace prefix. To check it in your org, from Setup, in the Quick Find box, enter `Installed Packages`, and then select **Installed Packages**.

**To confirm:** From Setup, in the Quick Find box, enter `Scheduled Jobs`, and then select **Scheduled Jobs**. The visit summary jobs are listed with their next run time.

## When a PDF Is Created

Each time the job runs, it finds visits whose **Status** is **Completed** and whose **Is pdf generated** checkbox is clear. For each one, it:

1. Creates the PDF, named with the visit name and the date of **Actual End**.
2. Saves it on the visit, as a Salesforce File or an attachment, depending on **Enable File** in the **File Configurations** custom setting, and adds it to the visit's account.
3. Emails it to the visit's sales representative, and to the account owner if that's someone else.
4. Selects **Is pdf generated** on the visit, so the visit doesn't get another PDF.

A visit becomes **Completed** in Salesforce only when the rep syncs after checking out. The PDF shows the data that's in Salesforce when the job runs. Anything that syncs later, such as photos uploaded at a later sync, isn't added.

If the email fails, **Is pdf generated** stays clear, and the job creates the PDF again on its next run. Email errors go to the user who scheduled the job.

## What a PDF Contains

| Included | Not Included |
| - | - |
| Visit name, account address, status, the quarter of the planned date, actual start and end times, and the rep | Photos and files added to the visit with **Attach File** or **Capture Photo** |
| Visit notes, with titles if your org uses note titles | Signature answers |
| Each task's survey, with its instructions, questions, and answers, in task order, with follow-up answers under their question | Tasks marked **Can't Do** in the FieldKo Atlas app, and their answers |
| 1 photo for each survey answer, if it's a Portable Network Graphics (PNG) or Joint Photographic Experts Group (JPEG) image | More than 1 photo per answer, other image types, and any photos after about 22 megabytes (MB) of photos in total |

For picklist questions, the PDF lists the question's current values and checks the ones the rep chose. For a multi-select question answered in the FieldKo Atlas app, only the first value the rep chose is checked. The full answer is in the **Answer** field of the task survey answer in Salesforce.

## Regenerate a PDF

**1. Check the Source Data First**

Fix the visit's data first, such as an answer or a missing photo. See [Find Out Whether It's the Data or the PDF](#find-out-whether-it’s-the-data-or-the-pdf).

**2. Clear Is pdf generated**

On the visit, clear **Is pdf generated**, and then save. If you can't see the field, add it to the visit page layout and check its field-level security.

**3. Wait for the Next Run**

The next run creates the PDF and emails it again.

**To confirm:** The visit's **Files** related list shows a newer version of the PDF.

> [!NOTE]
>
> With Salesforce Files, a regenerated PDF becomes a new version of the same file. With attachments, the account gets another copy each time. If you rename the visit first, the visit gets a new file with the new name, and the old file stays.

## Find Out Whether It's the Data or the PDF

**Problem or symptom:** A visit summary PDF is missing a photo, an answer, or a task, or there's no PDF at all.

**Applies to:** Salesforce admins and managers.

**Why it happens:** Either the data hasn't reached Salesforce, or it's in Salesforce but the PDF leaves it out.

**How to investigate:** Open the visit in Salesforce, and compare it with the PDF.

| What's Wrong in the PDF | Check in Salesforce | If Salesforce Is Also Wrong | If Salesforce Is Right |
| - | - | - | - |
| A photo is missing | The task survey answer's **Picture**, and its **Files** or **Notes & Attachments** | The photo hasn't uploaded. The rep syncs with **Sync Images** turned on. See [Photos Missing in Salesforce](https://support.fieldko.com/admin/support-diagnostics.md#photos-missing-in-salesforce). | The photo uploaded after the PDF was made, isn't a PNG or JPEG, isn't the photo the PDF picked for that answer, or came after the PDF's photo limit. If it uploaded late, regenerate the PDF. |
| An answer is missing or unchecked | The task survey answer's **Answer**, and the question's **Values** | The rep didn't answer, or the answer hasn't synced. | The task is marked **Can't Do**, the answer doesn't exactly match a current value (for example, the value was edited later), or it's a second or later choice on a multi-select question. |
| A whole task is missing | The task's **Status** and **Reason For Incompletion** | The task wasn't on the visit. | The task is marked **Can't Do**, or its survey has no answers. |
| A task's status looks wrong | The task's **Status** and **Reason For Incompletion** | See [Task Status and Completion Reporting](https://support.fieldko.com/managers/task-status-and-reporting.md). | The PDF shows the visit's status only, not each task's status. |
| No PDF at all | The visit's **Status** and **Is pdf generated** | The visit isn't **Completed** yet. The rep syncs. | The job isn't scheduled, the visit's **Actual End** is outside the summary PDF dates, or **Is pdf generated** is already selected. |

**How to resolve:** If Salesforce is wrong, fix the data first. Then regenerate the PDF. See [Regenerate a PDF](#regenerate-a-pdf).

**Expected result:** The regenerated PDF shows the data that's in Salesforce, within the limits in [What a PDF Contains](#what-a-pdf-contains).

**Escalation:** If the data in Salesforce is right and regenerating doesn't fix the PDF, email FieldKo support at [support@fieldko.com](mailto:support@fieldko.com) with a link to the visit and the PDF.

> [!NOTE]
>
> Some companies have a customer-specific visit report instead of this PDF, for example with scores or a separate report for each brand. That report is customer-specific configuration. Ask your admin or FieldKo support how it's built.

## See Also

* [Track Your Team's Performance](https://support.fieldko.com/managers/monitor-your-team.md)
* [Notifications and Email Alerts](https://support.fieldko.com/platform/automate/notifications.md)
* [Install and Set Up FieldKo](https://support.fieldko.com/admin/installation.md#scheduled-jobs)
* [Storage and API Allowances](https://support.fieldko.com/platform/licensing/storage-and-api.md)
* [Export FieldKo Data and Photos](https://support.fieldko.com/admin/export-data.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.