Readonly entire record based on certain condition

Hi All,



i need to readonly entire record based on below condition.
on case module there is status dropdown field, if the status is "Cancelled"  "Duplicate" and "Rejected"  entire record should be readonly.


Please note, i have used the ACL approach to achieve this functionality, i already applied the source code and tested, it is working fine.

But the issue is, it is only working with one Status mean if i add another status value in array it is consider only one status value.

below is my code, please check and suggest me something.




i have followed below link which is available on web


https://enricosimonetti.com/powerful-customisations-with-sugars-acl/#google_vignette

i request to all please suggest me how can i can multiple dropdown value to readonly entire record.

Any suggestion would be highly appreciated. 
Thanks in advance


  •  

    I see your point, try to understand the code, as I can see the code does work, but only for one condition.  

    it will only be one option here: array only use unique index... 

    you need to have something like

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    <?php
    [
    'Cases' => [
    'status' => [
    ...
    ]
    ]
    ]
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    After that you where u do the check you do in_array inside the loop.. that should solve your issue, 

    Rodrigo Manara

    Sr. Developer

  •   

    Thank you for your quick response
    i have tired to apply your approach but unable to fix my issue
    could you please provide me the complete code

  •   ,

    By looking at enrico's code/example, you might need to adapt the code as per  suggestion, make it an array of status's values and loop them through ..

    Rafael Fernandes

    Staff Developer Advocate | SugarCRM