attachments in workspace

VSN
Tera Expert

i have a requirement in configuration workspace to remove attachment icon .

 

VSN_0-1703086163680.png

 

 

20 REPLIES 20

Hi @Tai Vu 

here are the below snaps, please follow the number of file name.

UX screen sysid:- 4bd685bc43b47110cc25ff53e9b8f27c

ux screen condition :- 898beb9093530210e69afa497bba10a8

 

@konijetisumanth 

The issue is because of the line 14 & 15 from your screenshot "ux 3".

Let change it from

function isChangeClosed(change_request, record_id){
var gr = new GlideRecord('change_request');

to

function isChangeClosed(table_name, record_id){
var gr = new GlideRecord(table_name);

 

Or you can keep the param name change_request, just remove the quote inside the GlideRecord. Like below.

function isChangeClosed(change_request, record_id){
var gr = new GlideRecord(change_request);

 

Cheers,

Tai Vu

you can try this way for the above question to work 

 
SCRIPT
 
(function checkScreenVisibility(params) {
    var recGr = new GlideRecord(params.data.table);
    var isNewRecord = params.data.sysId == -1;
    if (!isNewRecord && !recGr.get(params.data.sysId)) {
        return false;
    }
    if (gs.hasRole('admin')) {
        return true;
    }
    if (params.data.table == 'incident') {
        return (recGr.active || isNewRecord) && (gs.hasRole('itil') || gs.hasRole('sn_incident_write'));
    } else if (params.data.table == 'change_task' || params.data.table == 'change_request') {
        return (recGr.active || isNewRecord) && (gs.hasRole('itil') || gs.hasRole('sn_change_write'));
    } else if (params.data.table == 'problem') {
        return (recGr.active || isNewRecord) && (gs.hasRole('itil') || gs.hasRole('sn_problem_write'));
    } else if (params.data.table == 'problem_task') {
        return (recGr.active || isNewRecord) && (gs.hasRole('itil') || gs.hasRole('sn_problem_write') || gs.hasRole('problem_task_analyst'));
    } else if (params.data.table == 'interaction') {
        return (recGr.active || isNewRecord) && (gs.hasRole('itil') || gs.hasRole('interaction_agent'));
    } else if (params.data.table == 'kb_knowledge') {
        return (recGr.canWrite() || (new global.KBViewModel().isVersioningEnabled() && new global.KnowledgeUIAction().getEditableFields().includes("short_description"))) && recGr.workflow_state != 'pending_retirement' && recGr.workflow_state != 'retired' && recGr.workflow_state != 'outdated' && recGr.canCreate() && recGr.canWrite();
    } else if (params.data.table == 'em_alert') {
        return gs.hasRole('evt_mgmt_user');
    }

    return false;
})(inputProperties);
 
 
 
PARAMETER MAPPING
 
{
"type": "MAP_CONTAINER",
"container": {
"table": {
"type": "DATA_OUTPUT_BINDING",
"binding": {
"address": [
"sowrecordctrl",
"table"
]
}
},
"sysId": {
"type": "DATA_OUTPUT_BINDING",
"binding": {
"address": [
"sowrecordctrl",
"sysId"
]
}
}
}
}

Hi @Tai Vu,

 

We have similiar requirement : to hide the attachment icon for one table . However we created a new custom experience (workspace) and not using any OOB workspaces. When we navigate to [sys_ux_macroponent] we couldn't see any record with that workspace. From UI Builder we can see the attachment icon. How do we hide it in this case. We can't locate the reference attachment in this above mentoned table

 

deepikakandila_0-1725430372058.png

deepikakandila_1-1725430413320.png

 

TramaineM
Kilo Sage

Hi @Tai Vu,

How can we set it based on the state of the case? For instance, if the state is closed which is "3". In platform view, there is a client script that works but it doesn't apply to the configurable workspace. Thanks