For each file in SharePoint a File 365 record will be created. To link the File 365 record to your Salesforce Objects, a lookup relation must be added to the File 365 record. Even if you specify the “All (wildcard)” option, you must add a lookup relationship to the File 365 object for all the Salesforce objects you want to use with File 365. Only for those objects that are linked to the File 365 object, File 365 will be active.
5.1. Create a File 365 Lookup Field #
Go to Salesforce Setup and select the Object Manager. Search for the Object “File 365” ( API: file365__f365_File365__c) and open the settings for that object. Go to “Fields & Relationships” and click New to add a new relationship.
Select Lookup Relationship and select Next. Choose the Object* to create the lookup relation to. This is the same Object as selected before in the “New File 365 SObject Location” screen. Set a custom label, name and child relationship name if needed.
You can leave other settings default and click Next. In the next screen select all profiles needing access to this relationship. On the next screen, where you can add the field to existing Page layouts, you should deselect all layouts and click Next.
The last step is to add a “Files 365” related list to the existing layouts of your chosen object. Check all layouts where you want to see the related File 365 records and click Save.
5.2: Modify Page Layouts / Lightning Record Page #
To use all features of File 365, ensure you the following components specified below on the page layout and/or Lightning Record pages as described in this section.
5.2.1 Page layout : Add and configure File 365 Related List #
Add the File 365 Related List to the Page layout of the concerned object. When you created the lookup relationship as described above, you added the related list already on the last step of the field creation wizard.
The Account and Contact look up fields are automatically configured for File 365 during the installation of the package. To use File 365 on those objects, add the File 365 Related list to the corresponding layouts.
By default, in the File 365 related lists shows the Columns File Name, File Extension, Open, Subfolder Path, Link To and File Last Modified Date. As with all related lists, the administrator can configure which fields are shown in the File 365 related List. We recommend to remove the ‘Link To’ field, as the related list is already on the page layout of the affiliated record.
Always uncheck the “New” and “Change Owner” buttons from the File 365 related list. These should not be used by users.
5.2.2 Lightning Record page: Add the File 365 Related List component, File 365 Toolbox #
You need to add two lightning components to the record page of the object you have configured to use File 365.
First you need to add a File 365 Related list component. You can either show the Files 365 Related list in the Related Tab (in this case you don’t need to do anything) or choose to add Single Related list component from the lightning components menu. Select File 365 as the related list you want to show in the lightning component. Second, you should add the File 365 Tools lightning component to your Lightning Record Pages for all the objects you configured.
The toolbox has three buttons. The Upload Files, Refresh and Open Folder button.
The Upload Files button allows the user to upload files to the related SharePoint folder. Uploading works also by using File Drag-and-drop to the toolbox.
The Open folder button opens the active record folder in SharePoint in a new browser tab, this is available by default. With the Refresh button you can refresh the file 365 related list after uploading files in Salesforce. Clicking this button will get all information from SharePoint linked to the record opened and create or update File 365 records accordingly.
After you’ve added the Toolbox component to the lightning record page in the settings of the Toolbox component, you need to tick the checkboxes for Manual Refresh, Upload, and Open Folder/Site to show these buttons.
Select Field to relate Files
Default setting is Id for relating files to the record you’re viewing. Alternative is to use a master-detail or look-up field to relate the file to a related record. (This property supports using an expression to define its custom label. The correct format is {!$Label.customLabelName}.)
If you want to show both the files related to the active record as well as files of a related record (the parent record f.e.), you need to add the toolbox twice and configure the ‘Select Field to relate Files’ accordingly. To add an extra toolbox is only necessary if you use the standard File 365 Related list. As the File 365 Gallery Related List features an upload button, the Select Field to relate Files can be configured in the settings of the File 365 Gallery Component itself. As should be clear, you do need to add the Gallery Component twice to show the two different sets of files.
5.2.3 Lightning Record page: File 365 Gallery Related List #
To preview multiple related files in one glance, we have added a new type of Related List: the File 365 Gallery Related List. To use this, drag the ‘File 365 Gallery Related List from the Custom Lighting components list onto the lightning record page.
Note that the File Gallery Related List component includes all three buttons of the File 365 Toolbox (Upload Files, Refresh and Open Folder), so adding the toolbox to the record page is unnecessary if you use this type of Related list.
After adding the File 365 Gallery component, click on the component to show the component details in the right side bar.
Tick the checkboxes for Manual Refresh, the Upload, and Add Open Folder/Site component to show these buttons.
Optionally, add a custom title.
As explained in the previous paragraph, the Field ‘Select field to relate files’ is used to determine which related files will be shown. Default for this field is Id to show the files of the active record. Optionally, a second File 365 Gallery Related List component can be added to the record page to show files of a related record instead of the active record, for example to show Account files on the Opportunity record. To do this, change the field name in ‘Select field to relate files’ to the field name (developer name) of the lookup field, in this case “AccountId”. (For detailed information how to set this up, view the File 365 Gallery tutorial).
Choose from several view options to show more or less file details: Detailed, Minimal and Thumbnail.