File attachment using Apex

  Рет қаралды 11,339

Inspirate Solution

Inspirate Solution

4 жыл бұрын

This tutorial will teach you to create a text file and attach it to contact object via Apex.
ContentVersion Information
developer.salesforce.com/docs...
ContentDocumentLink information
developer.salesforce.com/docs...!

Пікірлер: 31
@goverdhanjayaram3683
@goverdhanjayaram3683 Жыл бұрын
Thank you very much !! You have no idea how useful this tutorial is :)
@AmanKumar-zi3hx
@AmanKumar-zi3hx 3 жыл бұрын
My issues resolved. Thanks... It's straight forward and quality contenr
@vikasv007
@vikasv007 3 жыл бұрын
Excellent and thank you
@AmanKumar-zi3hx
@AmanKumar-zi3hx 3 жыл бұрын
@@vikasv007 Do you know how to add table of content similar to word in vfp?
@vikasv007
@vikasv007 3 жыл бұрын
There was a old thread where few were talking about this requirement. developer.salesforce.com/forums/?id=906F0000000994cIAA
@kadirali7284
@kadirali7284 3 жыл бұрын
Thank you for uploading this video
@vikasv007
@vikasv007 3 жыл бұрын
You are welcome
@mohitlalwani3505
@mohitlalwani3505 Жыл бұрын
Thank you so much Can you help me how to upload a file from external source.With the help of only apex not VF. Because VF i am not using.
@SandeepRahoolPV
@SandeepRahoolPV 2 жыл бұрын
NIce
@akankshac5854
@akankshac5854 3 жыл бұрын
Hi . Thanks for the tutorial. Can we attach an audio files .mp4 too like this in salesforce?
@vikasv007
@vikasv007 3 жыл бұрын
You can surely attach audio files.This might help developer.salesforce.com/forums/?id=906F0000000AW4NIAW
@demolast4847
@demolast4847 3 жыл бұрын
Nice and simple. Appreciate it! How can I send a file using rest api from salesforce to 3rd party? Do I have to send the body or any specific format of file? Thanks
@vikasv007
@vikasv007 3 жыл бұрын
You have to send as body something like EncodingUtil.base64Encode(FileData) in your HttpRequest. Also please make sure you set header something like Content-Disposition: form-data; name="file". You can get more info from developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition
@anilpoudel5974
@anilpoudel5974 2 жыл бұрын
Sir suppose I have AL3 file in my desktop and I need to convert that format and read using third party API how I will upload file in that API and retrieve that file in particular format without the use of any object just normally passing desktop file.
@dayapoudel
@dayapoudel 2 жыл бұрын
please reply on it
@aaadiaries2926
@aaadiaries2926 3 жыл бұрын
Hi..thank you for amazing tutorial.. can you please let me know how to query content document object for linked attachments of an object? I am getting null results when I query through apex but not through query editor
@vikasv007
@vikasv007 3 жыл бұрын
Hi there you can use this query SELECT ContentDocumentId,LinkedEntityId FROM ContentDocumentLink where linkedEntityid = :id where id is the id of the object where you have attachment it could be contact ,account or what ever. Once you have contentdocumentid you can query contentversion object with the above contentdocmentid to get title or other info. Hope that helps
@poojamane2634
@poojamane2634 3 жыл бұрын
Woww! Amazing video . Very straight forward , short and simple. I juss have one concern ...how can we put a data into this pdf in html format and display field's information in that pdf. It would be really greatful if i will get an answer. Thanks in advance!
@vikasv007
@vikasv007 3 жыл бұрын
Hiya does this help trailblazers.salesforce.com/answers?id=9063A000000DvybQAC
@poojamane2634
@poojamane2634 3 жыл бұрын
@@vikasv007 my requirement is when email is triggered that email template should get stored as an attachmemt on quote in pdf format.
@user-su9fr9ix4v
@user-su9fr9ix4v 2 жыл бұрын
hey, what if i need pdf and do it in quick action
@akhilabillakanti3435
@akhilabillakanti3435 3 жыл бұрын
Hey, Is it possible to give the path of the local file and get the file inserted into attachment object using apex? However, I see this is possible using dataloader, where we can just give the path for attachment body.
@vikasv007
@vikasv007 3 жыл бұрын
There were few discussion about it on Stack overflow. Have a look at this one. Hope this will help salesforce.stackexchange.com/questions/180120/attach-a-file-from-local-system-to-salesforce-using-apex/180126
@akhilabillakanti3435
@akhilabillakanti3435 3 жыл бұрын
@@vikasv007 Thanks!
@anjalisravanthi3616
@anjalisravanthi3616 2 жыл бұрын
Does this works for an image file?
@mohdimtiazali3865
@mohdimtiazali3865 3 жыл бұрын
send attachments from contact to opportunity when account of contact and account of opportunity is equall???please help please help in this answer using list set or map only you can tell manually also
@vikasv007
@vikasv007 3 жыл бұрын
If I understood correctly You are after attaching doc to opportunity object? And Perhaps trigger is Contact record I presume? There are multiple Opportunities for same account? So how are you going to decide which opportunity you are after. Let say Contact C has Account A which has say 5 opportunity. If you know which Opportunity then it is easy to do. First Load account and Opportunity to collection perhaps Map keeping Account as key something like this Map When you trigger contact compare the account of contact with id of Map by checking if ID exisit if it does get the right opportunity id and pass it as LinkedEntityId of ContentDocumentLink object.
@mohdimtiazali3865
@mohdimtiazali3865 3 жыл бұрын
@@vikasv007 thank you so much sir i am going to try this
@shubhampandey7489
@shubhampandey7489 2 жыл бұрын
Hi , I am not able to create content distribution records for content version records .error: insufficient privileges on cross reference fields.
@vikasv007
@vikasv007 2 жыл бұрын
could be access related issue have a look at access on object
@shubhampandey7489
@shubhampandey7489 2 жыл бұрын
@@vikasv007 hi. But can't find content distribution object
Get Started with Apex Triggers | Apex Triggers
6:27
Saurabh Infotech Solutions
Рет қаралды 35 М.
Salesforce Trailhead - Bulk Apex Triggers
6:15
Your Codding Buddy
Рет қаралды 56 М.
Beautiful gymnastics 😍☺️
00:15
Lexa_Merin
Рет қаралды 15 МЛН
Heartwarming Unity at School Event #shorts
00:19
Fabiosa Stories
Рет қаралды 19 МЛН
URL to File/Blob in JavaScript
10:14
OpenJavaScript
Рет қаралды 52 М.
Salesforce Developer Tutorial - Apex and LWC Debugging Techniques
51:50
Coding With The Force
Рет қаралды 12 М.
Dataraptors and Omniscript
27:08
SFDC Use Cases
Рет қаралды 2,9 М.
Generate a PDF!
15:17
21 Knots Salesforce Solutions
Рет қаралды 17 М.
JSON Serialization and Deserialization
43:01
Gyan Easy
Рет қаралды 17 М.
Send Email Attachments With Salesforce Flow
8:25
Rotive - Brian Hays
Рет қаралды 12 М.
Oracle APEX - File Download , View Image and File Upload - Sample
19:08