Questions tagged [attachment]

A standard Salesforce object representing file attachments related to another standard or custom object.

Filter by
Sorted by
Tagged with
24
votes
6answers
5k views

Most API call efficient way to retrieve all attachment bodies

I need to download the binary body of all the attachments in my organization. I'd like to do so with the least amount of API calls. It is my understanding that the SOAP API returns a single attachment ...
18
votes
5answers
9k views

Resize Image in Photo Upload in Visualforce before save in attachment?

Good Morning Friends, I am creating a Visualforce for my users to upload photos and these photos are saved in the attachments object, but I wonder if there is any way before the picture is saved I ...
16
votes
2answers
806 views

Is forcetk accessible in Communities

I am using forcetk to upload files (as Attachment records) in a VisualForce Page and it works fine. But when I access same page in a Community, I am not able to upload the file as I am getting the "...
13
votes
2answers
3k views

Large size Attachment upload auto-removed by Salesforce. Is it a bug?

I've a Visualforce page that uploads multiple Attachments selected by user. I used following code to upload attachments: ... <apex:repeat value="{!AttList}" var="att"> <apex:inputFile ...
12
votes
4answers
2k views

Download Invoice PDF's On List View without saving to Notes and Attachment as a zip file

Scenario: Am having Invoice__c Object. On the list view I have download button to download the selected invoices PDF's. What my below code is doing is it is after fetching the selected records id's of ...
12
votes
2answers
2k views

Fields missing using getContent call for Visualforce rendered as PDF

I am attempting to get the content of a visualforce page that is rendered as a PDF. I make some changes to the object that the visualforce page is displaying data from, update that object, make the ...
12
votes
1answer
415 views

How can I tell if a custom object supports notes and attachments?

I have some apex that generates a PDF and tries to attach it to a custom object type that the user defines. One issue I have with this is that if the type doesn't support notes and attachments this ...
11
votes
2answers
2k views

Save attachment with Remote Objects

is it even possible to save attachment with remote objects to salesforce? I tried this: construct remote object model <apex:remoteObjects jsNamespace="MyModel"> <apex:remoteObjectModel ...
10
votes
3answers
5k views

Is it possible to get a sharing link (to non SFDC users) from 'files'/'content' via apex?

A bit of background: I have a client that I built a custom model library for, and in this page they can select a group of models and email them (say instructions to the next gig or notify them of ...
10
votes
2answers
8k views

Upload an Attachment via the Rest API

I'm having an issue uploading attachments via the REST API. When trying to upload attachment data (i.e. data about the attachment and the associated base64 binary data) I'm getting a 400 result (Bad ...
9
votes
4answers
5k views

Has anyone done Drag and drop multi-upload functionality for attachments/files?

I'm trying to create a visualforce page where someone can drag and drop attachments to upload them and they can see a preview of attachments that they have already uploaded. There are a ton of jquery ...
9
votes
2answers
2k views

API Access to Google Doc Attachments?

Is there any way to query for Google Doc Attachments? For instance, the following SOQL queries return all Notes and Attachments whose parent is a Salesforce.com record, but I can't find any equivalent ...
8
votes
1answer
11k views

How to retrieve the file content for a ContentDocument object?

Previously, on Salesforce Classic, when a file was uploaded, it was saved on the Attachment object table. This object had the Body field. On Lightning Experience, however, attachments are stored as ...
8
votes
2answers
2k views

How to “deep clone including Attachments” without hitting the heap space governor limit?

I'm working on a "deep clone" Visualforce page where starting from an object, that object and its child objects and its grandparent objects and so on are cloned and that logic works fine. But any ...
8
votes
1answer
6k views

Using a component to add attachments to visualforce email template and showing email link

We are trying to add attachments to an email template using a component. The code in the email template is: <messaging:emailTemplate subject="My Subject" recipientType="User" relatedToType="...
7
votes
4answers
3k views

Can't use getContent() in a batch, future method, trigger etc

I have a VF page which has a method in the controller that generates PDF and sends it out via email. It's all working fine when I trigger off the method from a custom button on the page, which is the ...
7
votes
1answer
3k views

Is it possible to add an attachment to an existing Task or Event?

Using the standard Salesforce interface for Tasks (Page Layout), there is a related list for Attachments. However, there's no button to add a new Attachment to an existing Task, and when I edit the ...
7
votes
1answer
820 views

Visualforce: Why the display of an PDF-File inside an IFRAME works on a Sandbox but not in Production?

On a Visualforce page I have an IFRAME like this: <iframe class="viewer" src=""></iframe> It starts up an shows nothing because src is blank. Good. To store the actual PDF I upload it as ...
7
votes
1answer
2k views

Attachment trigger not firing, is this a bug?

The Attachment Trigger is not firing for before insert and after insert events when attachments are added via the UI (Related to Tasks) in Winter 14 Sandbox, is this a bug? I've reviewed the known ...
7
votes
1answer
2k views

Unable to upload an Attachment - Bulk API

I'm using Bulk API to upload attachments and getting an error: InvalidBatch : Failed to parse CSV header. Number of Records Processed: 0 While I'm getting following error at the Salesforce ...
6
votes
2answers
5k views

How to query a file uploaded as an attachment in lightning experience?

According to the release notes Lightning Experience Limitations, attachments uploaded in lightning aren't the same as attachments uploaded through salesforce classic. How can i query for the ...
6
votes
2answers
10k views

Can I add a field to the Attachment object (specifically a picklist to track the 'type' of attachment)?

The title says it all. I would like to add a field to the attachment object to be able to sort/filter based on the attachment's type (eg, 'Will', 'Account Opening Document', 'Correspondence', etc.). ...
6
votes
1answer
937 views

Uploading 100,000 binary files as attachments to Case record - best approach

I want to upload files (.doc, .pdf) from external system to the attachments of Case record. There are two approaches I have found from Salesforce Help. 1) Uploading Attachments by data loader ...
6
votes
1answer
109 views

Does sending a file to an external server fall under the heap size limit considerations?

I have to send SFDC files to a third party application, via custom apex. My only concern is, if my file size is 40 MB, will it fail due to the heap size limit? If yes, what is the workaround?
6
votes
2answers
541 views

Standard “Send an Email” with Attachments

I'm looking for a solution (AppExchange, github...) to select attachments from the list of Attachments when on the standard "Send an Email" page (/_ui/core/email/author/EmailAuthor). It looks like ...
6
votes
1answer
2k views

Can we have Web To Case Attachments?

I have to add an attachment to a web to case form... I know that we have form assembly app available... But is there any other way out? I have referred https://developer.salesforce.com/forums/...
6
votes
1answer
13k views

Difference between File and Attachment in SalesForce

We have been using Notes and Attachment to store files related to the record. I also read about Files in salesforce. How are Files different from Attachment? Are there any limitations or benefits of ...
5
votes
2answers
7k views

How to create csv files in controller method from list

I want to create csv files from lists and send an email attaching them, how to do that in a controller method?
5
votes
2answers
803 views

trigger BeforeUpdate failed when inserting attachments into new record on Demand object

as a follow up to my earlier question I am now getting BeforeUpdate trigger errors when trying to insert attachments as it says the ParentId field is not writable. so here below is the code that is ...
5
votes
1answer
1k views

renderAs PDF shows blank first page

I am using the html2canvas library to render the page with a view to rendering the canvas as a PDF. I am saving the canvas as an Attachment fine. The direct link to the attachment looks like this: ...
5
votes
1answer
990 views

not able to upload attachments to Accounts with External ID

I have a Salesforce implementation for a big company; every month the marketing department produces a report ( pdf ) for each client account; they ask me about batch process to automatically import ...
5
votes
1answer
6k views

Determine the correct file type extension for an Attachment

When using the Soap API to work with an Attachment how can I determine the correct file extension when saving the Body contents locally? E.g. I created a test attachment on an Account from a PDF. ...
5
votes
1answer
6k views

Save Pdf as a attachement in Notes and attachment using apex class(Without clicking on Button)

My question is regarding Save Pdf as in Notes and Attachment under the record, So, my issue is, First controller is fill the document(PDF) and Second controller can Save that PDF using that first ...
5
votes
2answers
1k views

One Class to control all Trigger. - Dispatcher

I'm having some problems when trying to make a number of classes and triggers to run on a dispatcher class. The components for this architecture are the following: One -TriggerDispatcher class. ...
5
votes
1answer
757 views

Display ContentDocument (Files) on site page

Currently, we have a feature in one of our products that allows you to upload an attachment to one of our objects to use as a thumbnail on the page it's displayed on. With attachments, I am able to ...
5
votes
1answer
579 views

Is there a way in apex to add 'force.com Content' files as attachments in emails?

I need to develop a way for users to select what content they want from a custom page and then have it added as an attachment to an email. I know you can add attachments to emails via: http://www....
5
votes
2answers
963 views

Parsing PDF Content

I have a PDF attachment. I want to add the contents of this attachment to another VF page that is rendered as PDF. Is there any way to parse the PDF contents in salesforce, which allows us to parse ...
5
votes
1answer
1k views

How include Salesforce file picker for a custom VF Page

I have a VF page where I need to attach files for an Email to be sent. I am using apex:inputFile for uploading the attachments. When you click on the "Browse" button next to the attachment, it opens ...
5
votes
2answers
379 views

How can you export an object's attachments based on a user-defined date range of record created date?

The customer requirement involves a user being able to provide a date range to identify a set of custom object records. For all object records that fall within that date range (assuming the Created ...
5
votes
0answers
281 views

Attachments auto download in Spring 16? Workarounds?

A client has an existing integration that runs daily, which calls a 3rd-party system to generate a report on new opportunities; the generated report is added to the Oppty as an Attachment, as an HTML ...
5
votes
1answer
124 views

Is there a way to show attachment logo in activity history?

in Salesforce there will have an attachment logo in emails like this: is there a way i can display attachment logo for activity history as well?
4
votes
1answer
19k views

how to upload files using Apex code

I am creating a VF page to upload files to to the Files related list of an object : I found out that files object is ContentDocument object. I am figuring out how I can create this ContentDocument ...
4
votes
3answers
6k views

Migrate attachments to Salesforce Files

One of our clients has a requirement to migrate attachments to Salesforce Files. They have also enabled this option from Winter '16 to allow file uploads to goto salesforce files instead of ...
4
votes
2answers
5k views

Salesforce isn't handling Base64 Encoded attachments uploaded via Rest API

I'm uploading an image as an attachment to an object in Salesforce via Rest API v32. My HTTP request body looks like so: --boundary_string_1416597802788 Content-Disposition: form-data; name="...
4
votes
2answers
2k views

Adding an attachment to salesforce from a remote site

If I have a remote site (a webform) with the ability for an unauthenticated user to add an attachment from their local machine to a webfom. When they click submit, we create a new record and add the ...
4
votes
1answer
1k views

Enabling Notes and Attachments after custom object creation

When I first started our custom object Request_for_System_Change, I didn’t check the box to allow Add Notes and Attachments – and according to the documentation SALESFOREC.com - Fields for Defining ...
4
votes
1answer
193 views

Triggering code on sObject Child Relationship actions

I have a scenario in which I would like to fire off some Apex functionality when an Attachment is inserted from an EmailMessage object (that is received via Email-to-case). The trouble is, it does ...
4
votes
2answers
2k views

Corrupt PDF when sending as email-attachment from Apex

I've created a VF page that allows users to select a list of custom objects related to a particular case, update some field information and attach pictures to any of these related objects. When done, ...
4
votes
1answer
1k views

how to host attachments outside of salesforce

Does anyone have experience hosting attachments outside of salesforce? I have a customer portal that allows file uploads via an authenticated sites user and it could potentially be a large number of ...
4
votes
2answers
942 views

Format for attachments coming out of SFDC through REST

I could really use some help here. What is the difference between cURL and using the javascript Request module that would make the attachments coming out of one perfect and the other garbled? Here's ...