5

As above, I'd like to set the Sync status on new Files programmatically - does anyone know if it's possible and if so how?

Files-info

When new File records are created, they are set to un-synced mode, meaning they won't appear in the desktop client etc. I would like to set this programmatically via Apex.

I've had a look at the ContentDocument and ContentVersion objects and I can't seem to find any field which controls this behaviour - am I missing something?

  • Bump, added a bounty. Anyone got any ideas on this one? – Davin Casey Jan 25 '17 at 10:07
  • Is it implied by being in a particular ContentFolder or ContentWorkspace? One that aligns with the sync folder from your computer. I tried to test it, but couldn't be the sync app working. If just sits in the "Starting" status. – Daniel Ballinger Jan 26 '17 at 18:55
0

Looks like it's not available in Apex or declaritive tools, but you can work with Salesforce Files Sync using the Chatter REST API.

Salesforce Files Sync

Chatter REST API for Salesforce Files Sync is generally available in version 31.0. To use Chatter REST API to work with files and folders, use these resources.

Move a file to a different folder

Move a file to a different folder using /chatter/files/fileId. These request parameters for POST are no longer reserved for pilot: isDataSync—The request is automatically generated by an automated client.

isInMyFileSync—true if the file is included in the user’s Salesforce Files folder, and is synced between that folder and Chatter; false otherwise.

These request parameters for PATCH are no longer reserved for pilot:

isInMyFileSync—true if the file is included in the user’s Salesforce Files folder, and is synced between that folder and Chatter; false otherwise. parentFolderId—ID of the containing folder.

Get information about folder, modify, or delete a folder To get information about a folder, modify or delete a folder, use /chatter/folders/folderId.

Get information about the contents of a folder and add items to a folder To get information about the contents of a folder and add items to a folder, use /chatter/folders/folderId/items.

And in particular for you:

Work with users files

isDataSync—The request is automatically generated by an automated client.

isInMyFileSync—true if the file is included in the user’s Salesforce Files folder, and is synced between that folder and Chatter; false otherwise.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.