I am building a custom communities app where users will configure their profile, and it will be displayed on a public listings page if they opt-in. As an FYI, the public listing page will be hosted outside of Force.com, but Force.com will be the master source of all data.

It would be nice to allow for users to upload a Company Logo to display alongside their listing. What is the best practice in terms of storing this Logo file? An obvious place would be to create an Attachment object, however it is unclear as to how to determine which Attachment is the Logo. Perhaps it would work to rename the file to a known convention prior to saving? Or is there a better way?

1 Answer 1


Dana, in native Salesforce I think regardless of where you actually store the file, you must have a known naming convention for the logo file. The reason is that you have no way of making a relational link (i.e., Lookup or Master-Detail field) directly from the company's record to the logo file.

To standardize a naming convention, one tip may be to create a formula field on the parent object, to the effect of Logo Auto File Name. If you want, you can create a unique text field and use a workflow rule to copy the auto-name into this field to enforce uniqueness of the logo file name. Then, in your code you can reference the auto-name field when creating and retrieving logo files.

For native file storage locations, you can consider the following:

  • Attachment object. I think this location makes the most sense and would be easiest to maintain.
  • Chatter Files
  • Document object with folders

Alternatively you could use storage integration with Amazon S3 or a similar provider.

  • Thanks for the advice :) While I think what you are saying is good and makes sense, there are still a lot of nuances to figure out. (Possibly because I didn't ask them in my post). I am going to wait another day or 2 to see if something else surfaces, but appreciate your quick response.
    – dana
    Aug 26, 2014 at 16:28
  • I'm going to go ahead and mark this on as "correct". I am planning to use the Attachment object to hold the logo and use a naming convention to reference it when needed. Thanks!
    – dana
    Aug 27, 2014 at 20:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .