Jump to content

Custom Fields limited to 255 chars: can they accept carriage return?


Recommended Posts

Some of the custom fields are stated as needing to be <=255 characters. My question is whether that can include a carriage return.

Mapping Fields from Customised Forms - Hornbill:

h_custom_a - h_custom_o VARCHAR/255 characters VARCHAR custom fields a - o each suitable for holding up to 255 characters of any type.

The use of the words "any type" implies to me that the carriage return would be acceptable but the Regex test facility in the edit field details is only a single line and does not allow for carriage return for those testing purposes.

Background:
I recently found out that if I plan populate a number of database custom fields direct from the intelligent capture form and one of those fields offends the data validation in the database for the custom field (such as being greater than 255 characters) then none of the data from the intelligent capture forms makes it into the database.

To resolve this issue I introduced a Regex validation of 255 characters on that field “^.{1,255}$” but I realised the expression did not allow a carriage return (which users want). I have since found a Regex formula that allows 255 characters including carriage return “^[^$.]{0,255}$” but I'm not sure whether that will be acceptable to the product.

Please can you advise (and then perhaps you can update your wiki?)?

Thank you in advance

Link to comment
Share on other sites

49 minutes ago, Berto2002 said:

The use of the words "any type" implies to me that the carriage return would be acceptable

Just for clarity, a carriage return (and new line) character is totally acceptable for input into these fields.

51 minutes ago, Berto2002 said:

the Regex test facility in the edit field details is only a single line and does not allow for carriage return for those testing purposes

Also for clarity, Hornbill don't write Regex - we don't have control over what it will or won't do but we provide it as an optional method to use for input validation.

 

56 minutes ago, Berto2002 said:

^[^$.]{0,255}$

Testing this in a validator, it appears to work over multiple lines until you use an actual '.' character, then it breaks, I have no idea why. If you exceed 255 characters it rolls back to the previous new line and starts a second match from there, so I'm not sure how it will perform in Hornbill.

Link to comment
Share on other sites

26 minutes ago, Steve Giller said:

Just for clarity, a carriage return (and new line) character is totally acceptable for input into these fields

Thank you. Then my quest for the correct Regex will continue! I understand this is not something you provide; but hey it would be nice to have the HB validator box cope with more than one row of text...

Link to comment
Share on other sites

Storing this example here to return to: removed the '.' and added [\r]

^[^$][^\r]{0,255}$

Seems to work for text involving multiple char types and special chars and more than one carriage return:

"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim

1) ok?

ad minimveniam,quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure"

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...