How to Generate and Store file in Salesforce Using Apex (Content Version & Document) ? - Salesforce

Sdílet
Vložit
  • čas přidán 4. 09. 2024
  • In this video we will learn about Content Version & Content Document and how can we generate and store files inside salesforce
    Like | Share | Subscribe | Spread Knowledge
    ________________________________________________________________________
    Follow Me:
    Facebook: / shubham.lashkan
    Instagram: / shubhamlashkan
    Twitter: / shubhamlashkan
    #ShubhamLashkan #Salesforce #Apex #Trailhead #CRM #ApexDevelopment #salesforcehulk #salesforcedeveloper #salesforcedevelopment #howto
    #contentverison #contentdocument #salesforcetraining #salesforcetutorials

Komentáře • 31

  • @rajatmehta114
    @rajatmehta114 Před 2 lety +1

    How to generate a pdf file in Files instead of Notes and Attachments??

    • @ShubhamLashkan
      @ShubhamLashkan  Před 2 lety +1

      When we create any pdf and link it to any object record like in the video i am linking to contact record then it automatically gets displayed on the files object

    • @rajatmehta114
      @rajatmehta114 Před 2 lety +1

      So it will be displayed in both notes and attachment as well as file?

    • @ShubhamLashkan
      @ShubhamLashkan  Před 2 lety +1

      Yes it will displayed on related Notes and attachments and on Files as well 👍

    • @rajatmehta114
      @rajatmehta114 Před 2 lety +1

      @@ShubhamLashkan Thanks!! It worked, do you know how can i update the pdf, like if I update the record, then only 1 pdf should be there and latest records should be appended in the same file.

    • @ShubhamLashkan
      @ShubhamLashkan  Před 2 lety +1

      Have to think about it. I will upload a video for sure in future 👍

  • @user-cc8uw3gx8v
    @user-cc8uw3gx8v Před 5 měsíci +1

    Your method of explaining the through developer guide is great. Thanks for making video.

    • @ShubhamLashkan
      @ShubhamLashkan  Před 5 měsíci +1

      Thank you for appreciation 🙏
      Please consider subscribing and share with community 🙏

  • @anandhikandasamy3330
    @anandhikandasamy3330 Před 2 lety +1

    Nice video! Really helpful for me to understand how the three objects are related. Thanks!

  • @rakshitrawat581
    @rakshitrawat581 Před 10 měsíci +1

    sir your explaination is so good

    • @ShubhamLashkan
      @ShubhamLashkan  Před 10 měsíci

      Thank You 🙏
      Consider subscribing and sharing with your friends 🙏

  • @nabinayasmin6102
    @nabinayasmin6102 Před 2 lety +1

    It was very helpful.

    • @ShubhamLashkan
      @ShubhamLashkan  Před 2 lety

      Glad it helped you understand the relationship between them 👍

  • @AkudikeChijioke-ht8ws
    @AkudikeChijioke-ht8ws Před rokem +1

    Adorable 💕

  • @subhrangshubanerjee9442
    @subhrangshubanerjee9442 Před měsícem +1

    Thanks for your nice video .
    Can we create same as an image file with .png extension? I created an image file but during opening the file it is showing as "It appears that we do not support this file format".

    • @ShubhamLashkan
      @ShubhamLashkan  Před měsícem +1

      Will try to do this and let you know.
      Please share the code which you wrote

    • @subhrangshubanerjee9442
      @subhrangshubanerjee9442 Před měsícem

      @@ShubhamLashkan Thanks for ur quick reply.
      Actually I was trying to save an htmlBody of emailmessage object into a pdf file so that user can use it later.
      It worked fine for few email messages but did not work for other few.
      I observed when an htmlBody contains an image which has src='', it is thowing error,
      I removed imamge tag dynamiccaly in apex code which has src='' ,
      it worked fine for that email message but did not work for all as html message may have different content.
      Did not find tha actual reason.
      I decided to save htmlBody into image but get error as below
      during opening the file it is showing as "It appears that we do not support this file format".
      ContentVersion cv = new ContentVersion();
      cv.Title = email.Subject; // dynamic
      cv.PathOnClient = email.Subject + '.png'; // dynamic
      cv.ContentLocation = 'S';
      cv.VersionData = Blob.valueOf(strHtmlBody); // strHtmlBody is htmlBody of emailMessage object
      insert cv;

    • @subhrangshubanerjee9442
      @subhrangshubanerjee9442 Před měsícem

      @@ShubhamLashkan Thanks for your quick reply.
      Actually I was trying to save an htmlBody of emailmessage object into a pdf file so that user can use it later.
      It worked fine for few email messages but did not work for other few.
      I observed when an htmlBody contains an image which has src='', it is thowing error,
      I removed imamge tag dynamiccaly in apex code which has src='' ,
      it worked fine for that email message but did not work for all as html message may have different content.
      Did not find tha actual reason.
      I decided to save htmlBody into image but get error as below
      during opening the file it is showing as "It appears that we do not support this file format".
      ContentVersion cv = new ContentVersion();
      cv.Title = email.Subject; // dynamic
      cv.PathOnClient = email.Subject + '.png'; // dynamic
      cv.ContentLocation = 'S';
      cv.VersionData = Blob.valueOf(strHtmlBody); // strHtmlBody is htmlBody of emailMessage object
      insert cv;

  • @nabinayasmin6102
    @nabinayasmin6102 Před 2 lety +1

    Can you make one video about how to make
    lwc component works in multiple language..

    • @ShubhamLashkan
      @ShubhamLashkan  Před 2 lety

      I haven't yet learned LWC for now but might be in future.
      But thank you for suggesting the topic 👍

  • @user-tk6cs6zn2m
    @user-tk6cs6zn2m Před rokem +1

    @shubhamLashkan
    So if i get Quote template from Quote template object to Opportunity Object? Can i able to download that from opportunity object?

    • @ShubhamLashkan
      @ShubhamLashkan  Před rokem

      Sorry i didn't get your question.
      Can you please elaborate.

  • @rognt-qx9hi
    @rognt-qx9hi Před rokem +1

    I have used visual force page to generate pdf by button click pdf is generated now what ever generated pdf should attach to related record can we do that

    • @ShubhamLashkan
      @ShubhamLashkan  Před rokem

      In this video i am relating the PDF to the record.

  • @rohantarale8251
    @rohantarale8251 Před rokem +1

    what if there is file already stored in attachment/files and I want that file to be attach in the email, is it possible to do...???

  • @TamilSelvan-vy3lm
    @TamilSelvan-vy3lm Před rokem +1

    how to add image as files in base64