File to Attach Multiple

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nickh
    Member
    • Jun 2018
    • 67

    File to Attach Multiple

    Hi all
    I have a client that has quite a few fields of type file but after 2 years they have asked if the fields can accept more than one file for upload.
    So simple question... is there a way to convert a File field to type Attach Multiple?
    Failing a simple solution, does anybody have experience with how to accomplish this task?
    Thanks for your consideration.
    Last edited by nickh; 11-28-2023, 05:43 PM.
  • esforim
    Active Community Member
    • Jan 2020
    • 2204

    #2
    Dont quote me on this but one trick I get this to work is to just delete the field, recreate it with same name.

    Comment

    • nickh
      Member
      • Jun 2018
      • 67

      #3
      Thanks for this.
      When you have done this, does it maintain the existing file that is already present and allow more files to be added?

      Comment

      • yuri
        Member
        • Mar 2014
        • 8455

        #4
        You will need to carry over related_id => parent_id, related_type => parent_type for entries in the attachment table where field = 'yourFileField' AND related_type = 'YourEntityType'.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • nickh
          Member
          • Jun 2018
          • 67

          #5
          Thanks Yuri. Very much appreciated.
          Sounds quite daunting when there are some 94000 attachments across 11 different fields. May try to encourage them to consider a different solution.

          Comment

          • yuri
            Member
            • Mar 2014
            • 8455

            #6
            It can be done with an UPDATE SQL query. Not that difficult. Just make sure you did a table backup before running.
            If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

            Comment

            Working...