Script Field Truncating

rhyno1
Giga Contributor

Hello, I'm hoping that someone in the community can help me with this issue.

I have added a script field type to a custom table that I have created.

When I insert a new record for editing and enter some script into the field and press save, it is truncated:

Enter some scrip in the field:

Script_Truncate_1.PNG

(The script above is just some random code for demonstration)

Press save:

Script_Truncate_2.PNG

The maximum length of this column is 8,000 characters.

I cannot understand why this is truncating? How do I stop this from truncating?

1 ACCEPTED SOLUTION

James_Neale
Mega Guru

It looks like you've created the field using default settings and then changed the length to 8000. This doesn't always work.


You need to drop the field and create it again (with a different field name unfortunately - if it was 'u_script', make it 'u_test_script' or something) - best bet is doing this process manually using the dictionary form and making sure the length is what you want it to be at the start.



Reason I can tell... "function onChange(control, oldValue, new" happens to be 40 characters.


View solution in original post

3 REPLIES 3

James_Neale
Mega Guru

It looks like you've created the field using default settings and then changed the length to 8000. This doesn't always work.


You need to drop the field and create it again (with a different field name unfortunately - if it was 'u_script', make it 'u_test_script' or something) - best bet is doing this process manually using the dictionary form and making sure the length is what you want it to be at the start.



Reason I can tell... "function onChange(control, oldValue, new" happens to be 40 characters.


Hey James,



Thanks for the answer, I appreciate it., this resolved my issue.


A bit late, but I think if you change the field size through dictionary rather than "Table - Macro Definition" it will change the column size.   This is how ServiceNow advised us to update the name column in ecc_queue.