Questions tagged [attachment]

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

Filter by
Sorted by
Tagged with
6
votes
1answer
14k 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 ...
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 ...
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 ...
8
votes
1answer
12k 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 ...
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?
2
votes
3answers
8k views

Displaying attachments on visual force page

I need to display attachments on a visual force page for the Case object. This is the code I am using. I had it working for awhile, but it somehow broke down. It gets all the attachments, but it will ...
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="...
4
votes
2answers
20k 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 ...
3
votes
3answers
10k views

Insert Attachment into Visualforce Email Template

this question: says that it is "hard" to put a component inside a visualforce email template because ' needs to be a child of component.'. Yet, is there a way to make this work? We also need to ...
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 ...
2
votes
2answers
2k views

How to use Blob.toPDF() method to create attachment body containing image and texts

I want to use Blob.toPDF() method to create attachment body, currently using: attachmentPDF.Name = account.Name + '.pdf'; attachmentPDF.body = Blob.toPDF(pdfContent);` Inside pdfContent I want to ...
4
votes
1answer
1k views

Adding an attachment to the EmailAuthor page

I would like to have a button on an opportunity page that generates and saves a pdf as an attachment object and then opens the /_ui/core/email/author/EmailAuthor page with the attachment already ...
3
votes
8answers
23k views

Is there a way to Download all notes/attachments from a Salesforce Opportunity?

I have found it time comsuming to click into each note/attachement and click save to a certain folder. Is there a tool that would allow me to pull all attachments from an opportunity to a folder on ...
2
votes
2answers
3k views

How Get Parent Field in Attachment?

Please Help me... Account sObject is Parent of Attachment. Now I want to bring Read-only Field Custom field (isReadOnly__c). SELECT Id, Name, Account.isReadOnly__c FROM Attachment How It Gets ? ...
1
vote
0answers
69 views

Open Attachment on Create of Child Record

I have a requirement for a custom app I am building to open an attachment on the parent record in a new window on create of a child record. I have parent object Quality_Assessment__c with child ...
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 ...
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 ...
16
votes
2answers
824 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 "...
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 ...
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 ...
7
votes
1answer
870 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 ...
3
votes
1answer
3k views

Visualforce page to render attachment.body

Im trying to build a visualforce page to render as an attachment. It seems doable but im getting lost in the content encoding issues.. here is what i have so far Visualforce Page: <apex:page ...
2
votes
1answer
416 views

List all attachments and notes for an id in date order

I have been using the below SOQL to get the Notes and Attachments that have been added to a record in my Custom Object Request_For_System_Change (alongside all the other fields I need, the below is ...
2
votes
2answers
8k views

What's the best way to migrate attachments from one SF Org to another?

Dataloader to csv doesn't work because of the binary Body, Dataloader to db seems to have problems with heap sizes and API limits ... so what works?
1
vote
1answer
142 views

How to download a attachment in browser using JSForce?

I am trying to download a Attachment using JSForce library. I am able to get body of attachment and download that file but somehow content of downloaded file is not correct and I am getting a corrupt ...
1
vote
1answer
6k views

Difference between Attachments and ContentDocument [closed]

I am trying to be able to download a file blob attached to a Case. I was first looking on the attachments table for the id of the file and realized it wasn't there and it was in ContentDocument. The ...
3
votes
6answers
6k views

Hiding “New Note” button

I am showing Notes & Attachment section. I want to hide "New Note" button on the related list. I don't find any way for doing that. How can I do that? Any thoughts?
3
votes
1answer
4k views

Attachment UTF-8 Character Set

I have a Apex Code which generates a CSV file and saves it as an Attachment under a record. The issue is that when the file is opened using Excel, few characters do not show properly. Eg: ' as well as ...
3
votes
2answers
4k views

Is there a way to report on attachments?

I've got a custom object that might have one or more attachments. I'm looking for a way to report on how many attachments there are on each record. I've done some research, and it looks like there's ...
3
votes
1answer
2k views

sharing a file via public link

Let's say we have a student object. Under Student Object, we have multiple files attached (such as certifications, etc). I want to expose public link for each files of each student. So that outside ...
2
votes
2answers
771 views

Why doesn't File Location Lookup show attachments of Opportunity?

My opportunity has some attachments. I would like to send them via email. If I hit on "Attach File" button of "Send an Email" page, then File Location lookup filter window, dialog appears, however I ...
2
votes
1answer
1k views

Uploading attachments using ForceTk

Please suggest me how to put attachments for a record under notes and attachments using forceTk, currently i'm using the following code and it creates attachments, but i'm not sure how to link these ...
2
votes
1answer
1k views

Email attachment not received in EmailService handler

I have an issue with processing inbound emails sent from MS Outlook. To put it simple no attachments are received in the class (nor text nor binary). Email definitely has attachments since i cc-ed the ...
1
vote
1answer
817 views

Limit for javascript remoting request

What I want to do is upload attachments for a record. For this, I was thinking of using javascript remoting and send attachments/files using remote action. Is there a limit for request data sent in ...
1
vote
3answers
3k views

Reducing size of the image when uploading in salesforce attachment

I have requirement where when images are uploaded in salesforce attachment, the image size or resolution should decrease.So that salesforce won't be overloaded. Can anybody help me out with any ...
1
vote
1answer
50 views

Didn't understand relationship 'Attachment' in FROM part of query call

I am trying to get all Accounts that has attachmentss. These accounts are of a particular record type, and has a certain value in Manufacture__c field This is what i tried list<Account> acc = [...
0
votes
2answers
8k views

Uploading an attachment using inputfile tag

I am trying to create a VF page using which I can attach files and save it to notes and attachment object. I am almost close but there is some problem with the code. I am using input file tag to get ...
0
votes
2answers
47 views

Open Attachment on Create of Child Record (2) [duplicate]

I have a requirement for a custom app I am building to open an attachment on the parent record in a new window on create of a child record. I have parent object Quality_Assessment__c with child ...
5
votes
1answer
998 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
581 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
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. ...
3
votes
3answers
3k views

File Attachment not working when attaching crm Content

I have a page where the user selects content (that is 5MB or lower, only 2 attachments allowed per email) to use as an attachment in an email. It all seems to work fine, the email sends and there are ...
3
votes
1answer
11k views

SOQL Query getting Notes and Attachments from Custom Object

I am getting an error when executing the below query in the Developer Console: select Id, Request_Title__c, (SELECT Id, Name FROM Attachments where id='a3K8E0000000BIj'), (SELECT Id, Title FROM ...
3
votes
2answers
3k views

How to upload 6Mb attachment in a custom Apex Rest service (heap size issue)

I have a .Net app, which works with SFDC via REST API. Not so long time ago we faced with big files. Usually they were around 2-3 Mb and it was OK for both .Net app and SFDC. Now there are some ...
3
votes
2answers
158 views

Need help understanding this apex trigger example

I'm just starting out in apex. I want to create a trigger that counts the number of attachments in a record of a custom object. I came across an example here. Here's the trigger code: trigger ...
2
votes
2answers
1k views

Associating an attachment with a custom object

I have written a small code snippet: public void setAttachment() { renderForm = false; System.debug('renderForm is'+renderForm); String fileContent = ApexPages.currentPage().getParameters(...
2
votes
1answer
3k views

Rendering attachment on visualforce page

I am having 2-3 attachment of different type (pdf/image/text etc). I want to display content of all the attachment on single visualforce page. Is it possible? If yes how can i go for it?
2
votes
2answers
2k views

Can we open files/attachments in Salesforce1 without enabling Chatter?

It appears the only way to open files in Salesforce1 is via "Salesforce Files" - previously called, "Chatter Files" which is tightly coupled to Chatter. When creating Chatter files, it seems to piggy ...
1
vote
1answer
2k views

Cloning attachment from Email Object to Case Object

I have the following Apex Trigger on the EmailMessage object (cases to email): trigger EmailMessageTrigger on EmailMessage (after insert) { List<CaseComment> CaseComments = new List<...
1
vote
3answers
608 views

REQUIRED_FIELD_MISSING, No body specified in the file attachment

I'm getting error when trying to send visualforce page as email attachment. public with sharing class PdfEmailController { // public ID PAId {get;set;} // public String email {get;set;} public ...