- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2025 06:01 AM
I'm trying to hide the attachment field from the form only in the default view. It should remain visible in all other views.
To achieve this, I wrote the following onLoad client script, but the field is still not hiding. I'm sharing the code below for your reference:
Despite this, the attachment field is still visible. Could you please help us identify what might be missing or suggest an alternative approach?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2025 07:45 AM
@Praju_123 , I submitted a record producer on the Incident table and attached a file during submission. However, when I returned to the form view of the table, the attachment clip was not visible for default view. Client script was working fine.
Shashank Jain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2025 10:14 AM
what do you mean by attachment field?
you are trying to remove the top header attachment icon and the header row right?
how is file attached to record producer?
Via paper-clip icon or some attachment variable?
share screenshots
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2025 06:18 AM
Hi @Praju_123 ,
Have you tried to give view name after removing global check box on right hand side in client script:-
This can be an alternative approach. Try once and share feedback.
Regards,
Nikhil Bajaj
Regards,
Nikhil Bajaj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2025 06:32 AM - edited 08-11-2025 06:33 AM
Do this and it should work fine
1) Ensure "Isolate Script" = false for your onLoad client script so that DOM is allowed
2) ensure you check Global checkbox so that it runs on all view, anyhow your script is checking the view name
3) this field if not on form can be marked as False from list view
Note: DOM manipulation is not recommended
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2025 06:59 AM
Hi @Ankur Bawiskar
I have already set the Global checkbox to true and Isolate Script to false.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2025 07:11 AM
Did you add alert and see what came in view name?
try this and share feedback
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader