File attachment using Apex

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ม.ค. 2025

ความคิดเห็น • 31

  • @goverdhanjayaram3683
    @goverdhanjayaram3683 2 ปีที่แล้ว

    Thank you very much !! You have no idea how useful this tutorial is :)

  • @AmanKumar-zi3hx
    @AmanKumar-zi3hx 3 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

    Thank you for uploading this video

    • @vikasv007
      @vikasv007  3 ปีที่แล้ว

      You are welcome

  • @SandeepRahoolPV
    @SandeepRahoolPV 2 ปีที่แล้ว

    NIce

  • @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

  • @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

  • @mohitlalwani3505
    @mohitlalwani3505 2 ปีที่แล้ว

    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.

  • @Богдан-н2к6п
    @Богдан-н2к6п 3 ปีที่แล้ว

    hey, what if i need pdf and do it in quick action

  • @anjalisravanthi3616
    @anjalisravanthi3616 3 ปีที่แล้ว

    Does this works for an image file?

  • @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 ปีที่แล้ว +1

      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.

  • @demolast4847
    @demolast4847 4 ปีที่แล้ว

    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  4 ปีที่แล้ว

      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

  • @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

  • @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 ปีที่แล้ว +1

      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!

  • @mohdimtiazali3865
    @mohdimtiazali3865 4 ปีที่แล้ว

    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  4 ปีที่แล้ว +1

      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 4 ปีที่แล้ว

      @@vikasv007 thank you so much sir i am going to try this

  • @aaadiaries2926
    @aaadiaries2926 4 ปีที่แล้ว

    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  4 ปีที่แล้ว +1

      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