Objective:
This article will present the factors that impact syncing photos from Youreka to Salesforce and how avoid common mistakes and improve sync time.
Before you get started:
These articles might be helpful before you read this one:
Every sync process from Youreka’s Mobile app back to Salesforce involves a few stages that we’ll break down further to see what can impact them. We’ll focus mainly on the impact to saving and syncing photos as these typically can be very large and time consuming.
Saving Photos for a Question
When taking photos from the mobile device’s camera or attaching from the photo gallery Youreka will compress these photos based on the Mobile Photo Resolution setting in the Mobile Admin, the larger the photos are allowed to be the longer it will take to sync them to Salesforce. The max is 2000 pixels. This compression happens once the photos are attached to the form and it’s saved. When changing pages, if the mobile device is online then Youreka will upload the photos to Salesforce in the background allowing the user to work on the next page. When Saving & Closing or Submitting the Form, if online Youreka will continue to sync any additional photos back to Salesforce. Otherwise if offline, all photos will be saved locally until the device has connectivity.
Uploading to Salesforce
This is the process of sending the photos from the mobile device back to Salesforce. Youreka uses the standard Salesforce REST APIs to upload the ContentVersion.
This process is dependent on the level of connectivity the mobile device has. Most WIFI connections will be significantly faster then cellular connections. For cellular connections it will depend on how many bars and if it is a 3G, LTE or 5G connection. In general Upload speeds are slower then Download speeds. If you search on Google “test my upload speed” you can find many sites that will test your average speed.
When syncing multiple photos at a time, the photo size is also a consideration. The larger the photo size, the longer the sync will take, because fewer photos will be sent at a time. When determining your photo size, consider the following:
- If photo resolution is 750 or less, we send 4 photos at a time (fastest).
- If a photo resolution is greater than 750 but less than 1125, we send 3 photos at a time.
- If a photo resolution is greater than 1125 but less than 1500, we send 2 at a time.
- If a photo resolution is greater than 1500, we send one at a time (slowest).
Saving Photos to Salesforce
Once the photos make it to Salesforce, they will be saved to the Salesforce database as a File and then available for viewing. You can read more detail about the File Object Model.
This will behave similar to saving any other Salesforce records and adheres to a strict Order of Execution.
The Objects that Youreka creates and updates when syncing Photos are:
FeedItem
FeedAttachment
ContentDocument
ContenDocumentLink
ContentVersion
Triggers on any File objects are not recommended by Salesforce, see this article. Triggers on these Objects are not bulkified by design and will significantly impact the time it takes to sync and save each photo. Due to the large number of Objects impacted by saving Photos we highly recommend avoiding any triggers or processes on these objects. Instead, consider using a Scheduled Job to run at designated times to update these photos or copy them to another platform.
In the Youreka Public Settings the Photo Metadata Chunk Size defines the batch size when saving these photo metadata within Salesforce. The default behavior is to send all photo metadata at one time. The lower this value is, the longer it will take to save Photos in Salesforce but will avoid hitting governing limits due to the Triggers not being bulkified.
Chatter Feed
When photos are attached to the Form record a Chatter Feed item is created for each photo. This is an extra step in the syncing and saving process and can be time consuming. In cases where Chatter is not needed on the Form object or there is a need to speed up syncing, disable Chatter Feed Tracking on the Form. This is enabled by default when installing Youreka.
Go to Setup | Feed Tracking find the Form object and then Uncheck "Enable Feed Tracking".
Comments
0 comments
Please sign in to leave a comment.