Question Concerning Deleting Photos

Viewing 1 reply thread
  • Author
    Posts
  • August 12, 2020 at 2:15 PM #41661

    Rocky Machado
    Participant

    Hi Team – Is it possible to delete photos using a script? I didn’t see any methods in the Javascript API. I’m able to cycle thru the photo object, but could not find a method to delete a photo.

    thanks,
    rocky

    August 12, 2020 at 7:07 PM #41663

    Brendan
    Keymaster

    Hi Rocky,

    Unfortunately there’s no direct way to delete a photo. But you can disconnect a photo from your record by either updating the array of dictionaries for the Photo field or if you want to clear them all, call record.setFieldValue(photo_field_id);. That’ll basically set the value for the Photos field to null. Call form.saveChanges(); after to save it. But the photo will still be on disk.

Viewing 1 reply thread

You must be logged in to reply to this topic.