« Notes 8.5 beta 2 start-up .. first impressions. | Main| Solid state drives in the news again (now with link) »

Notes design basic 2: Use the correct field data types

Category
Bookmark : del.icio.us  Technorati  Digg This  Add To Furl  Add To YahooMyWeb  Add To Reddit  Add To NewsVine 


The second of design basics.. (somewhat later than planned)

Maybe the title says it all, but its important to put the data in the right type of fields.  This may seem obvious but the number of times I've seen a number in a text field - arrgh!.  This most notably applies to dates and numbers.

Why do you want to do this?  Simply because you'll not have re-manipulate the data elsewhere.  So if you want your stored dates on a document to behave like dates in a view - store them in a date field.  This will allow the view to see the data as a date and when sorted will sort it correctly.  If the data is stored in a text field the sorting will operate on the basis that your date is just a bit of text.  

Then if you have to do calculations on the data in either Formula language or LotusScript - you won't have to convert the data first - a number will be a number and a date will be a date.

It is also important to keep the use of correct data types when doing calculations either via LotusScript or Formula.  If using Formula in a calculated field make sure that the return type is correct - if you return a string the field will have a data type of text, if you return a date it will have a data type of date/time - regardless of the field settings on the form.    And the same goes for LotusScript - where is probably even easier to over-ride the field type .. in fact, in my experience this is usually the culprit for data being in the wrong format - someone generates a data string and stores this, leaving you with typically date/time data in a text format.

This flexibility of the data type in Notes fields might be useful in some occasions - but I've yet to find an occasion!  It is great that Notes is forgiving about this at times - but this means you have to watch the data types.

Comments

Gravatar Image1 - Another reason for getting the correct data type is that FT-search gets upset if you change a field type afterwards (e.g. from text to number).

Gravatar Image2 - Thanks for help! This is just what I was looking for!

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)

Welcome ..

View Scott Cochrane's profile on LinkedIn

My IdeaJams

tag cloud

MiscLinks

Googles

  • No Search Referers

OpenNTF

Poweredby

Domino BlogSphere
Version 3.0.1 Beta 9