Limiting Text Field Length – User Property

Lot of time we have requirement which involves restricting user input to certain length. Most common way to do that is to specify the Text Length property of the field. I used to do that until recently when I came to know that even after specifying field length user was able to enter more than the allowed limit.

Going through the bookshelf I read a note which said

“Text Length property is usually ignored and the length is retrieved from the underlying column definition”

So, that in effect means that whatever is the column length at the database level is limit at the BC level too. But that is not what we wanted so after further exploration we came across a user property that could help us to limit length without modifying the column at database level.

  • Text Length Override

Text Length Override and it can have a value as TRUE which means enforce the Text Length field property or it can have a different value such as 10 or 20 which means that will become the new limit.

Here is a step by step procedure on how to use this user property.

  • Query for the BC in which the desired field is present
  • Select the field on which you want to enforce the limit
  • In object explorer click on the + sign against field and select User Property option as shown below
    Siebel tools Object explorer screenshot
  • Create a new record in the Field User Property area
  • Enter the following information

    Name: Text Length Override
    Value: TRUE

    OR
    Name: Text Length Override
    Value: 10

Where the number is the limit that you want to enforce and you are done. Compile and see the changes.

Note: This user property can only be used with text type fields.

Happy Configuration :))  !!!

This Post has been viewed : 27,551 Times


18 Responses to Limiting Text Field Length – User Property

  1. you can limit the length by using the applet-control-property HTML-ATTRIBUTES and apply something like:

    maxlength=30

    see an html-guide for more html-attributes for textfields

  2. you can limit the length by using the applet-control-property HTML-ATTRIBUTES and apply something like:

    maxlength=30

    see an html-guide for more html-attributes for textfields

  3. that’s intresting… will all the attributes work like color or style..

    will have check it out 🙂 but we can do pretty intresting things if that works out.

  4. that’s intresting… will all the attributes work like color or style..

    will have check it out 🙂 but we can do pretty intresting things if that works out.

  5. no, not all html-form-field attributes will work – check it out.

    ther is another way to restrict the text-length: the text-length is limited to the length of the underlying db-field size. if you can change the field, that should be the prefered way to restrict the length.

  6. no, not all html-form-field attributes will work – check it out.

    ther is another way to restrict the text-length: the text-length is limited to the length of the underlying db-field size. if you can change the field, that should be the prefered way to restrict the length.

  7. whatever you have given in the length property of that Field and usually if you give the length in the value of this user property it doesn’t work. So what we usually do is give the value as TRUE and give the length that you want to restrict in Length property of field

  8. whatever you have given in the length property of that Field and usually if you give the length in the value of this user property it doesn’t work. So what we usually do is give the value as TRUE and give the length that you want to restrict in Length property of field

  9. Hi,

    In the Bookshelf they have mentioned that Text Length Override User property is used only for Text Type fields.

    I want the same for the Number field. User should enter only 3 digit number. I used the coloumn which has the Physical length 3,but still it is accepting more than 3 digits.

    I used the script to restrict the user not to enter more than 3 digits. Can we achieve the same through the configuration.

  10. Hi,

    In the Bookshelf they have mentioned that Text Length Override User property is used only for Text Type fields.

    I want the same for the Number field. User should enter only 3 digit number. I used the coloumn which has the Physical length 3,but still it is accepting more than 3 digits.

    I used the script to restrict the user not to enter more than 3 digits. Can we achieve the same through the configuration.

  11. I guess this post is outdated and the material is not as per the latest bookshelf. Below is the updated stuff…

    The length of a field can be measured at 3 levels.

    1. database column length
    2. ‘Text length’ field property
    3. ‘Text Length Override’ field user property.

    Now note the difference between points 2 and 3.

    Point 2 mentions ‘property’ only, and point 3 mentions ‘user property’.

    So whats the big deal ?

    The deal is that, point 2 is useless in itself !!! Meaning, if point 3 does not exist, point 2 has no use.
    Let me explain what I want to say…or rather what bookshelf wants to say. It says that, if the user property ‘Text Length Override’ does not exist for the field, then that field’s length is not determined by the property ‘Text Length’, but it is determined by the database column length.

    If at all, you want the field’s length to be limited by the field property ‘Text Length’, then, you have to create a User property ‘Text Length Override’ and set it as TRUE. Actually, bookshelf also mentions that whatever value you set for this user property, the field length will be determined by the field property ‘Text Length’ and not the database col length.

    And as I mentioned earlier, if this User property is not created for the field, then the field length will be determined by the database column, and not by the property ‘Text length’ of the field.

    Also note that, this user property is applicable only if the field has text in it. Not any other data-type.
    Also note that, this user property will work on records created after it has been complied in the srf. Meaning, it will not work for existing records.

    Summarizing in one sentence only –> The field property ‘Text Length’ works when the field has a User Property ‘Text Length Override’ specified with any value and when the field has data of text type, else database column length is enforced for that field.

Leave a Reply

Contribute