How to Disable Attachment from Incident Form??

SandeepKSingh
Kilo Sage

Hi EveryOne,

 

Can you please tell me how we can disable an Attachment from Incident form?

@Ravi Gaurav can you help

2 ACCEPTED SOLUTIONS

Ravi Gaurav
Giga Sage
Giga Sage

You can use the below on Client Script:-

 

g_form.disableAttachments();
 
you can use onLoad or onChange based on the requirement.
 
 
--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

 YouTube: https://www.youtube.com/@learnservicenowwithravi
 LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

View solution in original post

Ravi Gaurav
Giga Sage
Giga Sage

Can you try this on BR (after Insert)

 

// Set the Attachments field to readonly
function onDisplay() {
var gr = new GlideRecord('incident');
gr.addQuery('sys_id', current.sys_id);
gr.query();
if (gr.next()) {
gr.attachments.setReadOnly(true);
}
}
please let me if it works

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

 YouTube: https://www.youtube.com/@learnservicenowwithravi
 LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

View solution in original post

2 REPLIES 2

Ravi Gaurav
Giga Sage
Giga Sage

You can use the below on Client Script:-

 

g_form.disableAttachments();
 
you can use onLoad or onChange based on the requirement.
 
 
--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

 YouTube: https://www.youtube.com/@learnservicenowwithravi
 LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/

Ravi Gaurav
Giga Sage
Giga Sage

Can you try this on BR (after Insert)

 

// Set the Attachments field to readonly
function onDisplay() {
var gr = new GlideRecord('incident');
gr.addQuery('sys_id', current.sys_id);
gr.query();
if (gr.next()) {
gr.attachments.setReadOnly(true);
}
}
please let me if it works

--------------------------------------------------------------------------------------------------------------------------


If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!

Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI

 YouTube: https://www.youtube.com/@learnservicenowwithravi
 LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/