How to remove update/delete from referenced image field?

richv
Kilo Explorer

Hello!

We have an issue with a custom app form which contains a referenced image field from another table. The User is seeing Update/Delete options on the image, and wrongly assumes that they apply to simply removing the image from the form, whereas of course deleting is removing the image from its own table.

We wish to remove the update/delete availability from the image when viewed as a reference. We cannot do this through ACLs, as the role in question must be able to achieve these functions when accessing the image in its native table, it is just we wish to restrict them from doing it here. Setting the field as read-only obviously will affect the native table as it is a reference, so is also not an option. We have attempted UI policies and client scripts which work fine on non-referenced fields, but will not work on the referenced image. Currently using Dublin version.

Any suggestions greatly appreciated,

Thanks,

Richard

1 ACCEPTED SOLUTION

Okay, try this.   'u_observation' is the table that you want to hide the links from, 'u_plan' is the name of the reference field on that table, and 'u_plan_image' is the name of the image field on the referenced table.



$('edit.u_observation.u_plan.u_plan_image').hide();




If this doesn't work, you can right-click the links in your browser and use a dom inspector to find out what the ID is.   This works in Fuji but may be slightly different in Eureka and Dublin.


View solution in original post

5 REPLIES 5

Hi Mark,

 

I am facing slightly different issue is there a way to show the [update][delete] option which is not working for a custom table when referring it from another record of same table