+ Start a Discussion

Hi Everyone



I want when an user enters an img URL into salesforce and clicks a button, that code would go out to the image online, downloads it and inserts it into Salesforce on the record as an attachment.can someone suggest me How to proceed with this.


Thanks in Advance

Doesn't seem to be straight forward one.

Try Doing a HTTP get call to the URL and check if you can save the payload returned in base64 format in SF



I would suggest the following approaches:

1) Create two custom fields
2) One field will hold the URL for the image you want to display
3) The other formula field will actually show the image, for details refer the following link which explains how to do this:



1) Take the image URL in input text field
2) On button call an action which would be defined in you controller.
3) In controller write code for downloading the image from the URL entered in input text field and attach it to the record.