# How Can I Get My Sequence Numbers to Default Properly on My List Grid?

If you are working with a List Grid that uses some type of sequence field (for example, `SEQNO`, `LINE_SEQ`, `SORT_SEQ`), there is a handy bit of technology that you can use that will cause the UI to do this job for you.

Just follow the steps below and you will solve this problem. The sequence field will be populated in your empty line, and any elements that are added from then on will have an appropriate value in the sequence field. If the user edits the sequence field at any point, the next element added to the list will incorporate the change without any problems.

Note: The default Sequence Number functionality will default the next nearest value from the highest sequence. The defaulting will do nothing after the sequence reaches the highest number it can hold.

- In the user exit file of the Tab Menu - not the main Page or the List Grid - copy this JavaScript code:

    			function initializeNewElement_LIST_NAME(newElement) {
    			      var myListName = "LIST_NAME";
    			      var myListSeqName = "FIELD_NAME";
    			      var myListMaxSeq = 999;
    			      defaultSequenceNumber(myListName,myListSeqName,myListMaxSeq,newElement)
    			}

    			</SCRIPT>
    			<SCRIPT src="/zz/defaultSequenceNumber/defaultSequenceNumber.js"></SCRIPT>
    			<SCRIPT>

- For `LIST_NAME`, substitute your List Grid's list name. Be careful not to lose that underscore [ _ ] just in front of `LIST_NAME` in the first line! Remember that JavaScript is case-sensitive and make sure that you use all UPPERCASE letters as shown here.
- For `FIELD_NAME`, substitute the name of your sequence field, whatever that might be in your List. Don't lose the quotes [ " ] ! Again, use all UPPERCASE letters.

Parent topic: Miscellaneous How-To's