Help to write formula API before save

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1837

    #1

    Help to write formula API before save

    Hi,
    in my entity I have some image fields, which I display conditionally, means, image field 2 only displays, when image field 1 is not empty, image field 3 displays only when image field 2 is not empty and so on.
    So if the user would delete image one, image 2 would not be visible anymore, even if not empty.

    Iwould like to throw a forbidden, if the user tries to delete a previous image, if there is a following one. What formula I could use?
  • victor
    Active Community Member
    • Aug 2022
    • 1126

    #2
    It seems that this can be achieved using dynamic logic: https://docs.espocrm.com/administration/dynamic-logic/.

    Click image for larger version

Name:	image.png
Views:	0
Size:	105.5 KB
ID:	124502

    Comment

    • shalmaxb
      Senior Member
      • Mar 2015
      • 1837

      #3
      victor, this I already have. I just want to prevent, that if a user uploads a second (and third and so on) image, he should not delete the previous one. I could use another logic, to make image 1 read only when having a following image, but this can lead to strange results, when a user wants to change image 1, as he will not be able and hardly understand, what happens. I the have to tell the user, ok, before you want to delete image 1 you must delete image 2, so the write protection is released. And after you uploaded your new image 1, then you can upload image 2 again.
      So I had the idea to not write protect any image, but throw a forbidden, if a user wanted to delete image 1, as long there is image 2 etc..

      Comment

      Working...