Announcement

Collapse
No announcement yet.

Disable Edit on particular entity status

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Disable Edit on particular entity status

    Hi all,
    i would like to disable the ability to edit a record (case) when status attribute of the record have a particular value.
    I know i can override record acl with a custom one by creating Espo\Custom\Acl\Entity.php, the class should extends \Espo\Core\Acl\Acl, but there is no checkEntityEdit method to override in \Espo\Core\Acl\Acl.php.
    Any suggestion on how to achieve this?

    I've tried by creating a checkEntityEdit method inside Espo\Custom\Acl\CaseObj.php, but the method never get called (checkEntityRead get called correctly however)
    Thank you in advance
    Last edited by Ceonello; 07-07-2021, 02:04 PM.

  • #2
    Doesn't Dynamic Logic work for this case?



    Use the ReadOnly when Status="Close" or something like that.

    Comment


    • #3
      It works yes, but we have a lot of fields and we would like to get rid of the Edit buttons too (on list and detail view), so something that would works for the whole entity would be better.
      I read this document https://docs.espocrm.com/development...or-entity-type that is exactly what i would love to achieve, but as it is it doesn't work since it's probably outdated.

      Comment


      • #4
        I don't think it would be outdated since it is part of the documentation; and if it outdated then you can do a Bug Report on that and adjustment can be made by yuri.

        With multiple field it does cause an annoyance in term of editing. I remember someone wanting to do something similar to you (in a way); found this thread:

        Reading the example of https://docs.espocrm.com/development/dynamic-handler/ does anyone know how to disable deletion of a record based on a field value ? Even if you cannot protect a record from deletion, at least the UI would not allow it. Eg: "Deletion of the person with name "Queen" is not allowed".


        Where he disable the delete button, perhaps you can adopt it to disable the Edit button.

        Comment


        • #5
          Ok, Thank you very much, I will check the thread you mentioned and fill a bug report since some of the classes used are now deprecated.
          By the way i think I (almost) solved my problem with a mix of custom acl and form dynamic handlers.
          Thank you very much for the support.

          Comment

          Working...
          X