Hide Attachments file

nikki11bira
Tera Contributor

I have requirement to hide attached files on RITM for a particular catalog item, I was able to achieve this using an UI script and client script to avoid DOM manipulation. I called UI script in Client Script.

But now I want to hide the attachments which are visible after clicking on Manage Attachment Icon. 

nikki11bira_0-1727243240578.pngnikki11bira_1-1727243255511.png

 

UI script : 

function hideAttachmentSection() {
    var attachmentElement = document.getElementById('header_attachment');
    if (attachmentElement) {
        attachmentElement.style.display = 'none';
    }
}
Client script : 
function onLoad() {
    //Type appropriate comment here, and begin script below
    var reqUser = g_form.getValue('requested_for').trim();
    if (g_form.getValue('cat_item') == g_scratchpad.propertyValue && (!(g_scratchpad.grp || g_user.userID == reqUser))) {
        hideAttachmentSection();
    }
}

 Please help me to hide the attachment files from manage attachment icon.

0 REPLIES 0