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 Timi

 

I have tried creating a new system property it did not work out and i have called it in snc_attachments for service operation workspace ux attachment and can you help me in how to condition it with my requirement.

 

for the above comment pfa

Hi @konijetisumanth 

You're pretty closed to it. The Attachment screen in the Change recorc is little different.

You can try this way to control the visibility of the attachment in the change task record in service operation workspace.

1. Make sure you're creating the condition for the screen below

URL: https://<instance_name>.service-now.com/sys_ux_screen.do?sys_id=4bd685bc43b47110cc25ff53e9b8f27c

2. New screen condition

Sample Script

(function checkScreenVisibility(params) {
	if(params.data.table === 'change_task'){
		if(gs.hasRole('admin')){
			return true;
		}
		return !isChangeClosed(params.data.table, params.data.sysId);
	}
	return true;
})(inputProperties);

/**
 * Validate change request has been closed
 */
function isChangeClosed(table_name, record_id){
	var gr = new GlideRecord(table_name);
	gr.addQuery('sys_id', record_id);
	gr.addQuery('change_request.state', 3);
	gr.setLimit(1);
	gr.query();
	return gr.hasNext();
}

Scripted Condition: True

Parameter Mapping:

{
  "type": "MAP_CONTAINER",
  "container": {
    "table": {
      "type": "DATA_OUTPUT_BINDING",
      "binding": {
        "address": [
          "sowrecordctrl",
          "table"
        ]
      }
    },
    "sysId": {
      "type": "DATA_OUTPUT_BINDING",
      "binding": {
        "address": [
          "sowrecordctrl",
          "sysId"
        ]
      }
    }
  }
}

 

Cheers,

Tai Vu

Hi @Tai Vu 

i have tried with above script in ux screen but did not work, in script i see calling input properties, so do i have to create a system property, if yes can you help me in how to create one.

Hi @konijetisumanth 

Everything is working perfectly on my end. Could you please review the following points and share some screenshots of your progress?

  1. The UX Screen where you created the condition.
  2. Verification that the Scripted Condition is checked.
  3. Confirmation that the Parameter Mapping is filled in.

 

Cheers,

Tai Vu