1 Reply Latest reply on Feb 11, 2009 1:04 AM by Neo719

    Many to Many Supplemental File Field

    Neo719 Level 1
      For detailed reasons I would rather not get into, I have a many to many relationship with a supplemental field for an image file name.

      My problem is that the Upload and Resize Image behavior does not recognize any of the Many to Many table fields for insertion.

      So, I can add the file field as a supplemental field of the Many to Many table, and I can upload and resize the images, but I cannot save the file name to the database field in the Many to Many table, nor can I ensure a file delete when the Many to Many behavior removes a record from the Many to Many (linking) table.

      Has anyone encountered this problem before or prepared a custom trigger to achieve this?

      NOTE: I can add the ability to delete the image files if the master record is deleted, but that does not prevent orphans from being created if a user unchecks one of the detail tables options. In that case the MTM behavior deletes the linking table record and orphans the image file.
        • 1. Re: Many to Many Supplemental File Field
          Neo719 Level 1
          An update:

          I CANNOT upload and resize the image. The mtm field has a dynamic name and id of "mtm_sampleImage__"

          The upload behavior reports an error:
          tNG_multipleUpdate error.
          An error occurred while updating the records. (MUPD_ERROR)
          File upload error: Error uploading file. No input of file type was submitted in the field "mtm_sampleImage_1". (FILE_UPLOAD_ERROR)

          It looks like the upload and resize image can't handle the field name with 2 dynamic elements. The behavior's gui called the form field mtm_sampleImage and I didn't realize it was going to fail on the two dynamic elements.