- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2018 03:55 AM
Hi
I changed the attachment file name size limit from 100 to 255 in sys_attachement table.Once again when I try to change to file name character size to 100, it is showing error as " Length change not allowed. The field 'File name' on table 'Attachment' contains existing data records (40) that exceed the new length of 100". But in this can what can I do??However i need to change the file name character limit to 100.
Solved! Go to Solution.
- Labels:
-
Instance Configuration

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2018 04:09 AM
The only thing you can do is go into the 'sys_attachment' table and find all of the records where the file name is greater than 100 characters and change them to something less. Here's a script you can run from 'Scripts -> Background' in your left nav to identify the problem records.
var att = new GlideRecord('sys_attachment');
att.query();
while (att.next()) {
var name = att.file_name.toString();
if (name.length > 100) {
gs.print(att.file_name);
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2018 04:03 AM
Find the existing records in sys_attachment which has 'File name' length more than 100 and then reduce them to less than 100 , then try changing the field length
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2018 04:06 AM
So do I have to make a query to fetch all the files which are having more than 100 character size?. in attachment table totally 450492 attachment available.how can i fetch ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2018 04:11 AM
You can use mark's script to find the name or update the script to print out sys_id and truncate it .

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2018 04:09 AM
The only thing you can do is go into the 'sys_attachment' table and find all of the records where the file name is greater than 100 characters and change them to something less. Here's a script you can run from 'Scripts -> Background' in your left nav to identify the problem records.
var att = new GlideRecord('sys_attachment');
att.query();
while (att.next()) {
var name = att.file_name.toString();
if (name.length > 100) {
gs.print(att.file_name);
}
}