function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sami amisami ami 

can i get record attachment content in to major record

Hi,

 

I have a custom object which has attachments.

I want to take the recent attachment and copy that link on to my record (custom field).

How can i do that??

 

 

Best Answer chosen by Admin (Salesforce Developers) 
Ashish_SFDCAshish_SFDC

Hi Ramesh, 

 

 

Try this, 

 

When requested from a valid session (i.e. after someone has logged in to salesforce) this URL (that includes the ID of the attachment) works:

/servlet/servlet.FileDownload?file=00PM0000001fH6h

If you create a text formula field on an object of this form:

HYPERLINK('/servlet/servlet.FileDownload?file=' + AttachmentId__c, 'View', '_blank')

 

http://salesforce.stackexchange.com/questions/17515/how-to-get-download-link-url-from-attachment-file-in-salesforce

 

Also, see the links below for more info,

http://stackoverflow.com/questions/11395148/related-content-stored-in-which-object-how-to-create-related-content-recor

 

http://stackoverflow.com/questions/5395682/where-do-i-add-a-trigger-for-notes-and-attachments-in-salesforce-com

 

http://sfdc.arrowpointe.com/2012/11/06/link-chatter-files-to-related-objects/

 

Add a post if there is something else that you are looking for.

 

 

Regards,

Ashish

All Answers

Ashish_SFDCAshish_SFDC

Hi Ramesh, 

 

 

Try this, 

 

When requested from a valid session (i.e. after someone has logged in to salesforce) this URL (that includes the ID of the attachment) works:

/servlet/servlet.FileDownload?file=00PM0000001fH6h

If you create a text formula field on an object of this form:

HYPERLINK('/servlet/servlet.FileDownload?file=' + AttachmentId__c, 'View', '_blank')

 

http://salesforce.stackexchange.com/questions/17515/how-to-get-download-link-url-from-attachment-file-in-salesforce

 

Also, see the links below for more info,

http://stackoverflow.com/questions/11395148/related-content-stored-in-which-object-how-to-create-related-content-recor

 

http://stackoverflow.com/questions/5395682/where-do-i-add-a-trigger-for-notes-and-attachments-in-salesforce-com

 

http://sfdc.arrowpointe.com/2012/11/06/link-chatter-files-to-related-objects/

 

Add a post if there is something else that you are looking for.

 

 

Regards,

Ashish

This was selected as the best answer
sami amisami ami
Thank you..
Yeah a trigger on attachment and a formula field on my object solved this.
http://salesforce.stackexchange.com/questions/17515/how-to-get-download-link-url-from-attachment-fil...

This link helped me.
Rachid El KaddouriRachid El Kaddouri
Hi RameshM,

What kind of trigger did you used? All of my triggers that I write don't work on the attachment for the custom object....

Hope you have some suggestions!

Kind regards,
Rachid
Shane Jay HayesShane Jay Hayes
I am trying to do something very similar and would love to see the code for the trigger sami