Skip to main content

I am in the process of converting my Attachments to Documents/Files since Salesforce is no longer going to support them.  I am using the Salesforce migration tool and so far so good!  (fingers crossed).  

I noticed that Skuid__images__c is listed as one of the objects that have attachments that could be converted to files.  I used this Skuid tutorial to create pictures of our Patients on the patient record, vehicles on the vehicle’s record, and houses on the House records etc. etc.  I am using the “In Field on Record” method with a lookup to the File object as outlined in the tutorial.  

My question is simply, is Salesforce’s change regarding attachments going to affect these images that are being displayed on the record like Jean Luke Picard in the tutorial?  The migrator is listing them as attachments not files so I am assuming they might be.  Is there anything we need to do with the File Upload tool to make sure we can still see and upload our images to be displayed in our records?

Thank you!


bump


Okay, I did some digging on this and my guess is that this is a big deal without some sort of fix.  I will give a quick summary and then outline in more detail below.

DISCLAIMER: This isn’t a current bug.  It is a future looking statement based on current trajectory 🙂

Driving Issue
: After Winter ’18, the Notes & Attachments related list will no longer have an Upload File button.

Summary: I believe converting Attachments to Files on the skuid__image__c model will break the images being displayed on all the pages.  Further, new images uploaded to the File Upload component using  In Field On Record as outlined in this tutorial get uploaded as Attachments not Files.  (I.E. if you click on the place holder image of the Person or Building it auto adds the upload as an attachment.)  This isn’t an issue now, but if the attachment button goes away it will be.  Also, I tested just replacing the Attachment with a File of the same name and that did not work.  So assuming it will auto rollover to Files may be a flawed assumption.

Steps to Reproduce:
In preparation for the new rule, I downloaded the Salesforce Magic Mover tool (it gets poor reviews but if you follow the prep steps before installing it worked flawlessly for me, everything has been converted with no issues except skuid__image__c and that is just because I haven’t hit the button because I think it will break Skuid).  The tool lists the total count of attachments for each object and lets you convert them to Files and then allows you to delete the attachments when you are done.  I went to each page where we were using attachments and built the new Content Document Link and COntent Document objects and table with the appropriate FIle Upload component.  Once everything was converted I tested to make sure everything was there and then deleted all attachments (using the tool) and deleted the attachment models out of the SKUID page since they were no longer needed.  I went through each object until I was down to CONGA Composer templates (saved as attachments) and skuid__image__c.  

I contacted Conga and Skuid (this post) to see what the future would hold.  Conga responded that the object should work fine with either Attachments or Files.  I tested one record by downloading the Attachment file and reuploading it as a File.  I then ran composer and it worked flawlessly.  So I went ahead and converted all my Composer attachments to files and then deleted the old attachments.  Everything worked without a hitch.

I contacted SKUID using this thread but hadn’t heard back yet, but the structure seemed similar.  Custom object with attachments instead of files.  Conga’s solution still worked so SKUID may be in the same boat.  So I navigated to a skuid__image__c record on one of my test person accounts.  This is an image of a person.  I downloaded the image directly from the skuid__image__c record and reuploaded as a file and then deleted the attachment (but left the record intact).  This broke the image on the account detail page.  So it was different than the Conga fix.  

To fix the issue I clicked the red delete button on the image which deletes the skuid__image__c record and then clicked the placeholder image and reuploaded.  This created a new skuid__image__c record and by default, it attaches it as an Attachment, not a File.  

If I have a flaw in testing my hypothesis please let me know.  But if I am right, this is pretty core functionality that is set to be end of lifed without a fix.  

Thank you!
Rich
p.s. I love SKUID I had been trying to run standard deviation on a number of child records for some of our DRs.  Everywhere I looked said Salesforce couldn’t do it.  But with SKUID + Salesforce I can calculate complex standard deviation equations for multiple child records within seconds.  Love SKUID.  Coolest thing ever!


Thanks for posting this. I’ll hope this comment “bumps” the issue for comment by the Skuid Gods.


Hi Rich and Raymond~

Sorry for the delayed response!!!

One thing I would like to highlight is that, per Salesforce, the change only affects folks who are using Lightning Experience. As far as how to proceed, I would recommend checking out this section Salesforce Notes & Attachments versus Files on the Millau release notes. To accommodate Salesforce’s change, in the Millau release, we added the option to easily upload files as Content Documents so they can be added as either Attachments or as Content Documents now. As far as the image component, you are right, the image sources are only attachment, static resource, and URL … I will bring this up with our devs and see what to do about that … I know this isn’t ideal but, can you try changing one of your images over to using the file upload component and see if that gets you where you want? Please let us know how that goes!!!

For people who don’t convert their attachments to files like Rich did, the question then becomes one of how do you display them? If you have a mix (some as attachments and some as content documents), you will need to bring both of them onto your Skuid page. On a standard Salesforce layout, you should see your attachments and files (what got uploaded as content documents) in the Notes & Attachments related list.

Hope that helps a little!
Karen


Rich,


Karen’s reply got me thinking about how to use Salesforce Files to store an image for a record. Skuid included all of the pieces necessary to do this ‘declaratively’. Thanks Skuid!


I have included a Contact Detail page that demonstrates how to do this. I have used the ‘Description’ field on the Contact object to store the Id of the ‘File’ that we want to display. Please replace this with a custom Text field (e.g. Patient_Image_ID__c).


To add an image, click or drag a file to the ‘New Contact Image’ button. To replace the image, you can click or drag a file to the ‘New Contact Image’ button. Or, if you have already uploaded the image as a ‘File’, you can click on the image and select a different file to display as the image for the Contact.


Thanks,


Bill

































































{{FirstName}} {{LastName}}


{{Model.label}}




ContentDocumentLink


























































Contact
&

Hi Bill,

I’m interested in your approach. Did the XML for you demo page get truncated?


Ant,

Not sure what happened with the XML.  Try this link to a snippet hosted on Gitlab.

https://gitlab.com/snippets/1727714

Thanks,

Bill


Thanks for that Bill. Works fine now, and a really useful example. Much appreciated!


Any suggestions on adapting the upload for a Product Detail Page? Displaying the image after the content document is created separately is one solution, but i’d like to be able to upload directly from the detail page. Trying to figure out a workaround but still getting the Large File error on upload.