01-19-2010 01:32 PM
Looking for a hint on the proper syntax to set the default value for a string and a Y/N field using the SDK.
Thanks
01-20-2010 02:33 PM
Me.FieldDescriptor = New Act.Framework.Database.FieldDescriptor(sFieldName, sFieldName, EntityDescriptor, Act.Framework.Database.FieldDataType.Character)
'---------------------------------------
' STRINGS
'---------------------------------------
Me.FieldDescriptor.Attributes(Act.Framework.Database.FieldProperty.DefaultValue) = New Act.Framework.Database.DefaultValueAttribute("DefaultstrValue")
'---------------------------------------
' BOOLEAN
'---------------------------------------
Me.FieldDescriptor.Attributes(Act.Framework.Database.FieldProperty.DefaultValue) = New Act.Framework.Database.DefaultValueAttribute(True)
Remember to lock the database before adding your field
'---------------------------------------
' LOCK the Database
'---------------------------------------
CommonPlugin.ACTFM.Database.LockDatabase(Act.Framework.DatabaseLockReason.SchemaChanges)
'---------------------------------------
' Save the field changes
'---------------------------------------
CommonPlugin.ACTFM.Fields.Save(Me.FieldDescriptor)
'---------------------------------------
' Unlock the database
'---------------------------------------
CommonPlugin.ACTFM.Database.UnlockDatabase()
Hope this helps
-- Jim Durkin
01-21-2010 06:02 AM