- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
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
4 weeks ago
@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 – Software Engineer | Turning issues into insights
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
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
4 weeks ago
Hi @Shashank_Jain
thank you for replying
When I called the view name and placed an alert below it, it was correctly showing the view name as "default".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
I tried it on my PDI, and it's working as expected.
You can run the Script Tracer to check if any other script is interfering, or share more details about your instance — for example, are you using domain separation or any additional custom functionality?
You can also try it on your own PDI; it should work there as well.
Shashank Jain – Software Engineer | Turning issues into insights
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
Hi @Shashank_Jain
It works only when the attachment field is empty.
However, in our use case, the record is created via a Record Producer, and an attachment is uploaded during that process.
We want the attachment field to be hidden in the default view, but visible in the Workspace view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
@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 – Software Engineer | Turning issues into insights
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
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