Forum Discussion

Nathan_H_'s avatar
Nathan_H_
Ideator I
4 years ago

Method to Hide/Disable Tab Buttons

Good day all.  Does anyone have a method for hiding/disabling the New Relationship and Delete Relationship buttons based on the state of the item?  We have a custom change ItemType, with a Relationship to Files called Redline Files.  I would like to be able to disable these buttons during the Review stages of the change.  Thanks for the help.

2 Replies

  • As I know, the access to these buttons is not supported. I used this code for a similar task, but this is a "dirty hack", it is not supported and it is not guaranteed that it will work.

    OnSelectRow grid event relationship type:

    [embed:dc8ab71f-3b98-42d9-b0f6-e21e02a0f8e2:db96fd16-8980-4107-ad19-e8c21c2c390e:type=javascript&text=var%20disableBtn%20%3D%20%27Your%20condition.%20True%20-%20disable%20button%2C%20False%20-%20enable%27%0D%0Avar%20toolbar%20%3D%20this.document.getElementById%28%27relationship-toolbars%27%29.children%5B1%5D%3B%0D%0Aif%20%28%21toolbar%29%20return%3B%0D%0Avar%20selBtn%20%3D%20toolbar.datastore.get%28%22itemview.relationshipscommandbar.default.selectitems%22%29%3B%0D%0Aif%20%28selBtn%29%20selBtn.disabled%20%3D%20disableBtn%3B%0D%0Avar%20crBtn%20%3D%20toolbar.datastore.get%28%22itemview.relationshipscommandbar.create_item%22%29%3B%0D%0Aif%20%28crBtn%29%20crBtn.disabled%20%3D%20disableBtn%3B%0D%0Avar%20delBtn%20%3D%20toolbar.datastore.get%28%22itemview.relationshipscommandbar.default.deleterow%22%29%3B%0D%0Aif%20%28delBtn%29%20delBtn.disabled%20%3D%20disableBtn%3B]