Comments on: Max Length on Large String Fields in ServiceNow https://servicenowguru.com/client-scripts-scripting/maximum-length-large-string-fields-servicenowcom/ ServiceNow Consulting Scripting Administration Development Tue, 28 May 2024 21:50:47 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Majid Raqba https://servicenowguru.com/client-scripts-scripting/maximum-length-large-string-fields-servicenowcom/#comment-6475 Mon, 06 Mar 2017 16:02:00 +0000 https://servicenowguru.wpengine.com/?p=574#comment-6475 I am new in servicenow working on ssr . thanks a lot. u are the king

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/maximum-length-large-string-fields-servicenowcom/#comment-6474 Thu, 21 Aug 2014 12:32:07 +0000 https://servicenowguru.wpengine.com/?p=574#comment-6474 In reply to Hema.

I don’t know of any way that you can temporarily increase the size, you have to have it large enough to store any data. I’ve never heard of the problem you describe though so I’d guess you’re using a different database config than the standard ServiceNow setup. The only thing I can suggest is to output the value of that field in your onSubmit script and then again in a business rule before and after update to the table to see where the value is getting lost. Then you’ll know where you need to increase the field length.

]]>
By: Hema https://servicenowguru.com/client-scripts-scripting/maximum-length-large-string-fields-servicenowcom/#comment-6473 Thu, 21 Aug 2014 09:24:05 +0000 https://servicenowguru.wpengine.com/?p=574#comment-6473 Hi Mark,

I have a multi line text field which is hidden in the catalog form and visible in the requested item page. I have text (whose length is exceeding 4000 characters) getting stored in this multi line text during On Submit and hence i see only truncated data on the requested item form. Is there any way to increase the size of the multi line text field such that how much ever text is stored during submit is visible on the requested item?

Thanks a lot in advance,
Hema.

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/maximum-length-large-string-fields-servicenowcom/#comment-6472 Wed, 05 Oct 2011 04:14:51 +0000 https://servicenowguru.wpengine.com/?p=574#comment-6472 In reply to Louwee G.

I haven’t ever tried it with 2 fields on the same form but I think if you’re having issues it’s because you’ve to 2 counters with the same DOM ID. You’ll need to change the following lines so that they are unique for each counter you use…

counter.id=’counter’;

var countControl = gel(‘counter’);

You’ll also need to change every place in the script that references ‘comments’ to be the name of your field.

]]>
By: Louwee G https://servicenowguru.com/client-scripts-scripting/maximum-length-large-string-fields-servicenowcom/#comment-6471 Tue, 04 Oct 2011 23:13:41 +0000 https://servicenowguru.wpengine.com/?p=574#comment-6471 hi, this script was very useful, but i am having a hard time applying the same script on a different field on the same form.

I am trying to use this same script on 4 different fields on the same form, i have attempted to modify the script for the 2nd field but it cancels out the 1st script on the 1st field.

Field names are u_header1, u_header2.

thanks in advance.

]]>
By: Derrick J Wippler https://servicenowguru.com/client-scripts-scripting/maximum-length-large-string-fields-servicenowcom/#comment-6470 Tue, 09 Aug 2011 19:56:17 +0000 https://servicenowguru.wpengine.com/?p=574#comment-6470 Here is a slightly more re-useable form.

function onLoad() {
   g_form.getControl('u_public_comments').onkeyup = function() { isMaxLength( 1000, 'u_public_comments' ) };
   g_form.getControl('description').onkeyup = function() { isMaxLength( 1000, 'description' ) };
}

function isMaxLength( length, control ){
   var control = g_form.getControl(control);
   if (control.value.length > length){
      g_form.hideErrorBox(control);
      g_form.showErrorBox(control, 'You have reached the maximum character limit for this field.');
      control.value=control.value.substring(0,length);
   }
   else{
      g_form.hideErrorBox(control);
   }
}
]]>
By: Priyanka https://servicenowguru.com/client-scripts-scripting/maximum-length-large-string-fields-servicenowcom/#comment-6469 Tue, 21 Jun 2011 22:54:23 +0000 https://servicenowguru.wpengine.com/?p=574#comment-6469 Hi Mark,

Thanks for the info.

I tried in ServiceNow demo and it works fine.. but its still not working in my instance.. :-(

]]>
By: Mark Stanger https://servicenowguru.com/client-scripts-scripting/maximum-length-large-string-fields-servicenowcom/#comment-6468 Tue, 21 Jun 2011 05:42:39 +0000 https://servicenowguru.wpengine.com/?p=574#comment-6468 In reply to Priyanka.

That should be all you need to do. I just tested on the ServiceNow demo instance and it worked without issue. You should confirm that it works for you there and then open a ticket with support if you still can’t get it to work in your own instance.

]]>
By: Priyanka https://servicenowguru.com/client-scripts-scripting/maximum-length-large-string-fields-servicenowcom/#comment-6467 Mon, 20 Jun 2011 23:23:26 +0000 https://servicenowguru.wpengine.com/?p=574#comment-6467 Hi Mark,

I am trying to reduce the width for a string in dictionary entry from 1000 to 200. But I am not able to..I tried disabling business rule “Dictionary Change Rationally” which prevents making string length shorter. But this too is not working.

Let me know if there is any way to do it.

]]>
By: Scott Hetzel https://servicenowguru.com/client-scripts-scripting/maximum-length-large-string-fields-servicenowcom/#comment-6466 Mon, 21 Jun 2010 10:37:35 +0000 https://servicenowguru.wpengine.com/?p=574#comment-6466 In reply to Anonymous.

Hi Mark,

That works great! Thanks…

Scott

]]>