0

Is there any way to distinguish between the types of attachments. Essentially I wanted to create a new field on type on the attachments object for distinguishing between pictures, docs and excel etc. Then I want to see the different types of attachments(based on the field) separately on a VF page. Please suggest some ideas.

Thanks

6
  • 2
    Notes and attachments both are different sobject.
    – Ratan Paul
    Commented Feb 16, 2016 at 11:01
  • @Ratan Talking about attachments. Thanks for pointing it out.
    – Prajith
    Commented Feb 16, 2016 at 11:04
  • 1
    Ohh are you looking for Type of attachment like doc image pdf etc? So you can use contentType field on Attachment.... Sorry your question was bit confusing
    – Ratan Paul
    Commented Feb 16, 2016 at 11:26
  • @Ratan Thank a lot and I agree on the confusing part.
    – Prajith
    Commented Feb 16, 2016 at 15:24
  • 1
    @Ratan Yeah decided to go with ContentType for now.
    – Prajith
    Commented Feb 16, 2016 at 15:28

1 Answer 1

1

Yes you can use ContentType on attachment to difference between their file extension. According to the docs

ContentType Type string

Properties Create, Filter, Group, Nillable,Sort, Update

Description The content type of the attachment. If the Don't allow HTML uploads as attachments or document records security setting is enabled for your organization, you cannot upload files with the following file extensions: .htm, .html, .htt, .htx, .mhtm, .mhtml, .shtm, .shtml, .acgi, .svg.

Attachment Reference

You must log in to answer this question.

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