Files, Content, Attachments, Documents etc.

What is the difference between Files, Content, Attachments, Knowledge documents? 

Files, Content, Attachments, Documents have always been a mess and are even more of a mess now we have Lightning. 

Attachments in Lightning

Attachments are meant to disappear in Lightning but here we are, more than 3 years into Lightning and still it's not advisable to remove the Attachments related lists from most records. 

Your Main Appexchange Apps may not work with files yet. Here are the ones I'm working with currently. 

Conga

Conga does have a files, and a chatter option at least, but how many Conga implementations are out there that are still saving to Attachments, and you only have Chatter as an option if you want to specify the parent. Oh and at least they allow you to support Versioning of Files and they allow you to attach files to a Merge. So overall not to bad. Here is their overview of Files. Over to me to change ALL my button URLS to use Files (do you know how much I HATE changing Conga buttons and HATE the way Conga does buttons?). 

Docusign

Cool, Docusign now writes to files but it's a bit of a setup. I've set that up now, so I will report back! 

Also WHY OH WHY does Docusign still use Token Authentication! Not cool at all. 

Nintex Document Generation / Drawloop

Nintex has a good overview page about converting to Files. I just wish ALL appexchange providers did a simple overview like this for all new Salesforce things that affect their product. My client using Drawloop was set up on Lightning so this has not been much of an issue.  

Web Developers

Getting a web developer to save a file to a record rather than just download a github repositiory that saves an attachment via the REST API is just like bashing your head against a brick wall. There is no incentive for them, more code is more maintenance, and attachments still work, right? This is what it takes to upload a file to Salesforce using the REST API and Java!, and here's one using the Chatter API. This one is hard. 

Cirrus

I gave up with Cirrus. Their support was woeful. I don't know if it's just my client's configuration or what it is, but here is the situation: 

You check Email Message Object in Org settings, so that you can use the lovely new Enhanced Email in Salesforce. With this setting on you get
- No HTML formatting in the email whatsoever - just a jumble of text
- No ability to turn on the Chatter setting in your personal Cirrus settings.
- No ability to save the attachments to the Contact / Account / Lead / Opportunity record directly - they are only ever saved on the Email record.
- No ability to click the link that is generated by Cirrus to go directly to the Email record because a task is actually created by Cirrus and immediately deleted, and it's that Task that is linked, not the Email record.
- Oh, and it also seems to delete the link between the Email record and the Contact record, although I would need much more testing on that - but it happened twice with two different contacts and emails.

You don't have Email Message Object checked in Org settings and you check Save email attachments to Chatter feed on your personal settings. With this setting you get
- No ability for the Org Admin to ensure that ALL attachments are saved to the Chatter feed, it's up to the individual user.
- No in-line images shown in the Task - so not a true record of the Email that was sent

So, not a good situation with either scenario.

Converting Attachments

So they make you convert Attachments to Files so you can see them in Lightning. OMG WHY! Why do you make us do this? Why haven't you just made this a thing out of the box. And there is an Appexchange Labs app, which I'm using, or a Community built App (By Doug Ayers who now works for Salesforce) as the two options to use. And I have to keep running it as Attachments keep showing up. 

And becuase I can't remove the Attachments related list yet, I have files and attachments showing up in both lists and it's dammned confusing for users. 

Well at least Doug Ayers's app does have an automated converter. https://github.com/douglascayers/sfdc-convert-attachments-to-chatter-files I will have to try that to keep on top of random attachments from here on in. 

Oh and of course I stuffed it up, so take heed so you don't stuff it up like I did. I was blindly converting away because there were so many to convert and it was taking sooooo long. BUT I accidently converted my Conga Template Attachments which put all the OLD attachments as the latest attachment on the Template record that meant those old old templates were being served up as the current templates! Don't convert Conga Template Attachments! (But that brings me to a whole other topic as to why Conga chose to create Templates as records, probably because documents sucked so badly, and file libraries in Lightning are still not ready for prime time). 

Attachments on Tasks

So we are left with Tasks becuase Cirrus can only save emails as Tasks, not as Emails. And Tasks are archived after 12 months. That's OK, I have no issues with that as I hate tasks, BUT!. 

In Classic you can see the attachments on the Tasks on the Record. In Lightning you can't!!!!!

In Classic you can see the attachments on the Archived Tasks. In Lightning you can't! And THIS IS BY DESIGN! 

Here's what happened

  • When Lighting came out there was no way to even see Archived Tasks you had to switch back to Lightning. This was the idea. In Winter '18 they released a "fix" saying Archived Tasks will be available. It's a complete hack (note that link is still visible even though it is not that way in Winter '20 anymore), difficult to get to, and a half-arsed job of doing it. What it seemed they did is just produce what looks to be a VF page with the text of each Task on the page - just keep scrolling until you happen to find what you want.

  • BUT there is NO WAY to see the Attachments on those Tasks on that stupidly long page.  

  • Clicking on a link to the Task, that you can get from Classic or many other places, showed an error like you don't have permission to view that task. This is now fixed in Winter '20

  • So of course, the community responeded - and had to come up with a Stage 2 Idea saying - hey you broke what you released last time around. MY GOD this is bad! If I had not had such terrible support from other companies that are not Salesforce recently I would say this is the worst experience with software tech support. 

  • And then they have the gall to say THIS IS BY DESIGN

  • THANKFULLY Most of this is now fixed in Winter '20. The activity list just keeps on getting longer and longer and you can see ALL the old tasks in there, and no Error when opening an Archived Task. PHEW! 

  • You can also add the Task History list view as a Related List - Single Component AND have the activity timeline on the page too. I would add the history in a separate tab so you don't have to see it unless you need to look at really old Activities. Thanks Brent Downey for the tip (https://success.salesforce.com/0693A000006jNA7 login in with Success), as I did not realise this was possible. 

As you can probably gather this makes me really really angry. I live by the tenent of Do No More Harm when designing systems for my clients. And here, Salesforce has done harm by removing the ability still making it really really hard to see attachments on Tasks older than 365 days in lightning AT ALL. For all other Attachments you can see them if you still keep the Attachments Related List. For Attachments on Tasks < 365 days old it is ridiculously difficult that you have to go through each email one by one to see which one has attachments and then open that up and then go to Related lists to see the Attachments, but at least they are sitll there. 

Look this is FINE for brand new orgs, but I have a clien who's org is 11 years old, one whose org is 7 years old and moving to Lightning this year, and this client whose org is 4 years old and has heavy heavy use of Email saved as Tasks with a heap of attachments. That are all still valid today. And needing to be used. They deal with certifications, and sometimes clients email their certifications in, those emails are saved as Tasks and the attachments are still on the emails. 

How does Salesforce think they can impose Lightning on paying customers and REMOVE THEIR DATA! Now I am a huge fan of Lightning but this is just outrageous. 

I do hope I'm wrong. Am I wrong? Please tell me I'm wrong. 

Removing the rant, but it is still terrribly terribly terribly bad and this is not a fix. 

How to fix this mess, hopefully!

  • Before I converted the Attachments to Files I downloaded a list of all the Attachments - so I have the Attachment Id and the ParentId (the record it is attached to). From that I can see which attachments are linked to tasks by filtering on ParentId beginning with 00T - from 2014 to now, that is 12682 attachments. 

  • The Conversion process gives me a file for each conversion showing me which Attachment Id is now which File Id

  • I can download the Tasks including Archived using Dataloader to get the Task Id and the WhatId on the Task which tells me which record the Task was linked to. Remember to use The Export All Option! That gave me ~35000 Tasks (both archived and not). 

    • Then there were some tasks not linked to records so I had to get the WhoId - that was about 6000 then there were still 215 tasks that were not linked to records at all. Not bad for 5 years, so I will leave those. 

  • The Files are linked to the Task even though you can not click on that link to the task in Lightning, you can at least get the Task Name (If you just found the file on it's own in Lightning you would have NO WAY of knowing which record the Task was linked to). 

  • So matching all that data together I can add a ContentDocumentLink record with the ContentDocumentId (File Id), LinkedId (record the Task is attached to) and set the Share Type as Inferred (I) and set Visibility as AllUsers. 

  • And THEN I will have to continue doing that conversion process each month for all the attachments that still come in. NOPE, it's been months later and I have not converted any attachments as the process was too much of a nightmare... see below for a sort of work-around for now. 

Now the issues with this

  • The file will exist as a file on the object - this is good. 

  • The file properties will show that it is still linked to the task - Ok

  • They click on the task they get an error - AS DESIGNED - SO NOT OK

  • The only way they can see the Task that delivered the file is to copy the Task Name, go to the Activity Feed, scroll all the way to the bottom, open the button that says View All, do ctrl+f in the browser, find the text of the Task Name and HOPE that it is the ONLY task in the list that has that name, becuase there is not even a LIST of the files that were attached to that task. 

What an absolute nightmare! But at least we will see the files. FAAAAAAARK! 

Oh not so quick! Of course I ran into problems - I ran out of API calls doing this as there was so many records to update and then that caused the backup to blow up. So be careful! 

Viewing Files and Attachments Generally

Oh yeah, there is this one too From Doug Ayers's Related Files Component

When viewing the Classic Notes & Attachments related list on an account, for example, attachments belonging to the account and its related contacts, cases, opportunities, tasks, etc. are displayed in one combined list.

When viewing the Lightning Files related list on the same account, for example, only the files explicitly shared to the account are displayed. The files shared to its related contacts, cases, opportunities, tasks, etc. are not displayed in the same combined list.

This is a known limitation and by design according to this help article.

However, this "rollup" of Classic Attachments is a much beloved feature and customers are asking for it in Lightning Experience.

Just get it, and use it. It is vital!

So it's for this reason, viewing files across records as to WHY you need to convert the Attachments to Files as it is the ONLY way you are going to see Files in the same way as you saw Attachments in Classic. Absolutely Absurd! 

So yes, Doug's Related Files component is so good, but no, I am not going to deal with manually moving Attachments to Files in bulk each month. So I've begged Doug to include Attachments in his component. The Idea, that has now been updated to say, nope, we are not doing it, includes a paid compoenent US$4/u/m and another free component, so let's try that... 

Files Attachments & Notes Component

https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FMYjqUAH

Look it actually does the job but it's so damn ugly that I can not recommend it at all. Even the screen shots on the appexchange show that they have not lined up the buttons - this is just basic UI stuff. 

It has two components - simple and full. The Full component is what you get to when you click on the Simple list. Do NOT use the full component on the page, it is far too long and overbearing, and ugly. 

This is the simple component. Why doesn't it line up! (the green line is my markup). It's good that it shows files and attachements. It doesn't show the mini file preview like the standard components. I don't like to encourage use of Notes so it would be good if there was an option to NOT show the New Notes button there. 

This is the full component, and the view that is seen when you click on view more in the main component. Why oh why is it so ugly? 

  • Again the New Note button does not line up. 

  • The Account Name does not need to be shown on the header. 

  • There is no option to ALWAYS show Attachments - this should be a component option and NOT those ugly toggles. 

  • Again, give me an option to not show the New Note button. 

  • Allow me to sort, or determine the sort. 

  • The Related to Task only shows the ID not the Subject of the Task. BUT At LEAST they are shown. 

  • The Component runs over the edge of the component boundary. 

  • It does not scroll - the component just expands to the size of ALL the files. 

DO NOT use this Component. 

And for the other reasons, I can't recommend this app at all. Sorry. I just don't trust an app that has glaring UI issues like that. 

OK they have fixed a few of the issues and the UGLY toggles are gone, but the New Note is still in an ugly location. So I will revise this to use maybe, but there are better options out there, but thank you to the developers for at least allowing the new settings!

Reporting on Files

Oh yeah, so you can add Custom Fields to files - great you say. But then try to report on those custom fields - Nope. Not Possible. See https://success.salesforce.com/ideaView?id=08730000000ktOLAAY. To quote directly from that Idea 



TBH I have never seen a single idea that I needed get implemented, I don't even know why I come to these pages.

Yep, just getting more and more angry at each turn with these files and attachments issues. And don't get me started on Emails, or Documents or Content yet! Geez! 

Outbound Email Attachments

Wait!? So Attachments attached to outbound email messages are still Attachments? Not Files? 

Now I know there is something funky with files on outbound email messages when they are attached to the Lightning Email Template, but I'm just so mad about no new features in Lightning Email Templates in two whole releases, and Lightning Email Templates being basicually useless still, that I'm not going to look that up again. 

But open an Email Message Record. There is no Files related list and no ability to add Files related list to the Lightning Page or the Page Layout. 

What? Why?