Questions tagged [attachment]

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

Filter by
Sorted by
Tagged with
2
votes
2answers
20 views

Copy Attachment to File Issue

On lightning, I changed the File Settings and checked on this feature: “Files uploaded to the Attachments related list on records are uploaded as Salesforce Files, not as attachments” In my code, ...
0
votes
1answer
27 views

Salesforce Files Settings - Expected Behavior?

We were looking to migrate to Files as a first step to prep for a Lightning migration and noticed a potential useful setting: "Files uploaded to the Attachments related list on records are uploaded ...
0
votes
0answers
25 views

Attachment download problem

When ContentType field on attachment is populated, /servlet/servlet.FileDownload?file= url template is being redirected to /content.force.com/servlet/servlet.FileDownload?file= url, which opens the ...
1
vote
1answer
119 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 ...
0
votes
0answers
15 views

Problem sending email with attachment

I have a method to send email with attachment but some weird stuff keeps occuring where some emails + attachment arrived to the accounts that are returned by the query but some didnt receive anything ...
1
vote
2answers
52 views

Converting attachment to files, heap size exceed exception

I am trying to convert our existing attachments to contentVersions using batch. But problem I am facing is that some of the attachments are of size greater than 12Mb. So when I try to run my batch I ...
0
votes
1answer
19 views

Optional parameter in apex (sending email with PDF)

I have Messaging.SingleEmailMessage method return type that requires several parameters when its called, the code is below; public Messaging.SingleEmailMessage createEmailMessage(Id templateName, Id ...
0
votes
1answer
25 views

Not able to view attachment in salesforce, when uploaded through Multipart Rest API

Below is the code which I'm trying to insert attachment through API not sure what is wrong, when I try to open 'Failed to load pdf' error comes or if I send image type file then that also doesn't open ...
0
votes
1answer
27 views

Community Plus users are not able to get the attachment using standard salesforce API

We want to get attachment BLOB data using the standard salesforce API. See the API Docs link below. ([https://developer.salesforce.com/docs/api-explorer/sobject/Attachment/get-attachment-id]) We are ...
1
vote
1answer
34 views

Convert an apex attachment into a blob?

I am attempting to convert an apex attachment into a blob. My visualforce code is <div class="mt-5 row"> <div class="d-flex justify-content-center col-lg-12"> <...
0
votes
0answers
18 views

Unable to append content to existing attachment

I am trying to add content to an existing attachment. However the new content is never getting added to the attachment and the file only has the original content. Below is my code: List<Attachment&...
2
votes
1answer
39 views

Insert attachment via Apex failed

When trying to insert new attachments, sometimes I come across this error: Insert failed. First exception on row 1; first error: UNKNOWN_EXCEPTION, BlobField : U#360.3fffffff (Attachment) U#360.aff (...
0
votes
0answers
28 views

Adding attachment to the Email using Rest API

I am calling API EmailMessage and storing email-related content, Now I have attachments in email so how can I set it on a particular email using REST API? What I am using is this: https://developer....
0
votes
1answer
28 views

Salesforce Files - Is it possible to link a file with Case + specific user and skip it from Content Document link API call?

We've a use case where our customer wants us to link a File record to Case but not fetch it via Content Document link API call i.e. mark it private for selective internal Salesforce users. In nutshell,...
0
votes
0answers
20 views

File preview issue of ContentVersion data that is copied from Attachment Body blob

I've created my own custom Solution object for SF Lightning use. I'm trying to migrate existing SF Classic Solution's Attachment Body blob data to ContentVersion versionData blob data. Below is the ...
1
vote
0answers
22 views

Image getting rotated while inserting in rich textarea field using attachament

Facing this problem while uploading image using iPhone salesforce one app. In the attachment the image is showing right, but when the same image from attachament is inserted into rich textarea it is ...
0
votes
0answers
18 views

Downloading The attachcament gives Blob result in csv`

I have made a lightning component to download the attachment associated with a custom object record. The downloading is working perfectly, however the downloaded file is opened with blob data. The ...
0
votes
0answers
19 views

Unable to share an attachment with Community User / record owner

How do I: Share an attachment with a Community User, who owns the record. In this case, the Community User owns the Opportunity and Account, and the attachment is in the Opportunity Configure ...
0
votes
1answer
48 views

Can I have PageReference within PageReference?

I am working on this requirement. I have a SaveAction() pagereference method in my controller on the Button click from the Input VF Page, where I am saving the VF page's input field values to an ...
0
votes
1answer
56 views

Generating a PDF and attaching after clicking on Submit from VF page?

I have a simple Contact creationg VF page with bunch of input fields. Clicking on the Submit button would create a Contact record and shows a confirmation message on the screen. Now, I would like to ...
0
votes
1answer
22 views

Limit only one pdf in attachment/salesforce files per object record

I have a requirement where i need to make sure only one pdf can be uploaded via attachment or salesforce files in an object record. In case user tries to upload another pdf in the same record it ...
0
votes
0answers
42 views

Apex Error (Image to PDF conversion) : BLOB is not a valid UTF-8 string

So i have this task where i have to convert the image uploaded in Notes and Attachment object to PDF. For that i created a trigger(before insert) on Attachment object and used the below mentioned code,...
1
vote
0answers
17 views

How to give Content Type while downloading attachment from url?

I am trying to download attachment from link : <a href="{!'/servlet/servlet.FileDownload?file='+attachment.Id}" target="_blank">{!attachment.name}</a> but the attachment is being ...
0
votes
1answer
44 views

Can I force Google Chrome to download Salesforce Image Attachments?

Whenever I click View or Download on an Attachment in Salesforce, if it's an image, it simply previews the image in my browser. For every other file type, I get the usual file download. Is this a ...
0
votes
1answer
33 views

How to send a email(pdf visualforce page) to particular user on clicking the custom button? [closed]

I have made a visualforce page to generate a pdf when a custom button is clicked and I'm struggling to send the generated pdf to mail id of that particular user.I tried all the possibilities.How ...
0
votes
1answer
18 views

Is it possible to move Files under Activities to Opportunities/Accounts

As Salesforce Files of Archived Activities are not displaying in Lightning, our Sales manager is asked to try an option. That is to move the Files attached to Task/Events to its associated Opportunity ...
2
votes
1answer
32 views

How do I find out which Account is associated with a specific ContentDocument?

When the user attaches a file to an account, this triggers the ContentDocument trigger. What logic should I put in the ContentDocument trigger to have it find the associated account?
2
votes
1answer
47 views

Salesforce Files - Integration related queries

While Salesforce is pushing adoption of Salesforce Files, here are few questions from an integration product point of view: Is it mandatory to convert older attachments to files? What is new object ...
0
votes
1answer
60 views

attachment pdf loop not working

I have a problem with a oncomplete button. The goal is to do a loop throughout all my custom object and to generate a pdf and attach it to my custom object. I manage with the following loop to attach ...
0
votes
0answers
22 views

id vf page attachment not working

I have 2 vf pages (one is a clone of the other one without the action) The first one called S : <apex:page action="{!saveAttachement}" standardcontroller="aktarus__C" extensions="Audit" ...
0
votes
0answers
40 views

insert attachment getcontentaspdf not loading data dynamically

I have a method that call a vf page and render as pdf the following Pagereference test = new Pagereference ('/apex/claire'); return test; that gives me the page I am expecting after that the ...
0
votes
0answers
13 views

Migrate Private Notes and Attachments

The Private Notes and Attachment migration module from the tool (Magic Mover for Notes And Attachments to Lightning Experience) seems to be removed. Can anybody confirm if the latest version of the ...
0
votes
0answers
23 views

PDF Failed to Load Error while Combining Blob Data to merge Documents

I have a requirement to combine blob data to create a single PDF File, and store them in attachments. While doing so, I am not able to preview the document created, which indicate that there is ...
0
votes
1answer
36 views

Attachment trigger work not persisting

i am trying to append the case id to attachment using trigger i have written correct logic but not getting any error and not appending case id to the attachment here is my code Trigger: trigger ...
0
votes
0answers
11 views

Millions of files migration in Salesforce

I need to migrate millions of attachments(in GB) from Salesforce. I have used dataloader.io to create .csv file and imported that file in different org by workbench. But when I want to preview the ...
0
votes
0answers
12 views

Preview knowledge article attachment on VF page from content document object

We have migrated our knowledge base from classic to lightning. We are using classic community(VF pages and tabs) to show KA to the external users. Earlier we were able to preview the article ...
2
votes
0answers
89 views

Sending 100KB attachment via HTTPRequest throws System.UnexpectedException

I'm trying to upload an attachment from SF to a third party server using REST API, First, my third party does not support base64 content-transfer so I cannot send from SF a base64 attachment. ...
0
votes
1answer
65 views

How to extract attachments data in Lightning Experience?

I'm currently using the Document object/table in SOQL to extract attachments in Salesforce classic. As far as I'm aware in Lightning it is necessary to use File instead of Document object to extract ...
1
vote
3answers
54 views

How to tell the object type of an Attachment

I need to export all of the attachments of an org. I would like to break them down to be in a folder based upon the object type of their parent. In other words, I want all attachments which are in an ...
0
votes
0answers
21 views

How to delete an attachment stored in a file field in a Knowledge article?

I have inserted the attachments in the file Field of knowledge Articles through apex.Is there any way to delete those attachments stored in the file Field.I have to delete the attachments in the bulk.
1
vote
1answer
56 views

How to store huge text in Salesforce record

I want to store the content of a small book in a Salesforce record. I want to make the text to be searchable by the Standard Salesforce UI and via Apex and SOSL and display it in Lightning UI. I know ...
2
votes
1answer
44 views

Prevent attachment of Certain type while sending email

I have been trying to prevent an attachment of type pdf while sending emails within Cases. I create an email, attach a pdf document. The process builder fires on Email creation which in turn calls a ...
0
votes
1answer
35 views

Batch callout: How to upload Attachments from multiple objects (dynamically)?

I am trying to upload an Atttachments based on the selection and criteria from Lightning Component that will be saved to Custom Setting. For example, the criteria is Opportunity - Stage - Closed Won, ...
2
votes
2answers
70 views

Calling REST APIs based on a session established via a community login

I'm currently dealing with an authentication issue with two different Salesforce REST API endpoints. We are trying to consume the API from inside a Visualforce page in a Salesforce community. To do ...
1
vote
1answer
273 views

Trigger on content document to retrieve the body

I believe this question is a possible continuation of this other question: How to retrieve the file content for a ContentDocument object? I am trying to get the body of a JSON file that is uploaded ...
0
votes
0answers
17 views

Logic implementation on multiple attachments of a chatter post

Looking for a solution to put a check on the file type that should be allowed to be uploaded on chatter(lightning experience). For now, I am able to put this check via FeedItem trigger in the scenario ...
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?
0
votes
0answers
36 views

How can I prevent unauthenticated users from downloading an attachment?

I have a community and internal links to attachments. They end with ...servlet/servlet.FileDownload?file={ID} When the user clicks the link, a window.open(fileUrl) is called. This prompts to download....
0
votes
1answer
89 views

Attachments in FeedItem After Insert Trigger

I'm trying to get the attachments from a FeedItem after insert trigger, but it does not return all the associated attachments. I understand attachments are inserted after the FeedItem is inserted (ref....
0
votes
0answers
28 views

How to Print attachment on a Salesforce site?

I have a Salesforce.com site where there is a button to open a div containing a iframe for a attachment. I'm able to show the attachment but not able to print the attachment using a custon button. We ...