How to Conditionally Disable Adding Related Records?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xiv
    Junior Member
    • Apr 2024
    • 14

    #1

    How to Conditionally Disable Adding Related Records?

    Dear Community,

    Is there a way to prevent users from adding related records based on a specific condition? For example, when the status of a record is set to 'Closed' users should no longer be able to edit that record (which I know can be handled for individual fields via the Entity Manager - Fields settings).

    However, my question is: how can I disable or block users from adding or creating related records from the bottom panel (disabling '+' and '...' buttons) when the status is 'Closed'?

    Any advice or solutions would be greatly appreciated!

    Thank you!
  • lazovic
    Super Moderator
    • Jan 2022
    • 1109

    #2
    Hi xiv,

    Disabling buttons depending on the condition can only be done by modifying the EspoCRM code.

    However, you can also consider using the API Before-Save Script so that users are notified that they cannot create a related record if its parent (or just another related record) has a certain status: https://docs.espocrm.com/administrat...re-save-script.

    Comment

    Working...