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.

  • 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:

    var disableBtn = 'Your condition. True - disable button, False - enable'
    var toolbar = this.document.getElementById('relationship-toolbars').children[1];
    if (!toolbar) return;
    var selBtn = toolbar.datastore.get("itemview.relationshipscommandbar.default.selectitems");
    if (selBtn) selBtn.disabled = disableBtn;
    var crBtn = toolbar.datastore.get("itemview.relationshipscommandbar.create_item");
    if (crBtn) crBtn.disabled = disableBtn;
    var delBtn = toolbar.datastore.get("itemview.relationshipscommandbar.default.deleterow");
    if (delBtn) delBtn.disabled = disableBtn;

  • Alaxala,

    Thank you.  I will give this a try.