SmartObject Authoring - Changing Text field length

  • 13 August 2009
  • 2 replies
  • 0 views

Badge +1

Hi,


I am creating SmartObjects programmatically. 


When I create an 'ExtendObjectProperty' with Type = PropertyDefinitionType.Text, by default Text is stored as varchar(100) in the SmartBox . Is there any way to change the length programmatically before calling the Create method? Or any other way?


Thanks


2 replies

Badge +10

Hi,


Add the following to your ExtendedObjectProperty:


property.Metadata.AddServiceElement("maxsize", "200");


Smartbox SmartObjects have several service elements which are implemented in exactly the same way:



  • decimalplaces
  • encrypted
  • constantsize
  • sortby
  • unique
  • maxsize

Credit to Jannes for providing these elements and how to implement them.


Regards,


 

Badge +1

Hi Johan,


Excellent! Thanks a lot for the reply, I was starting to think about updating the SmartBox DB but felt it would really be a "kludge".


I'll give this a try.


Cheers

Reply