Default values upon adding or modifying records...


Author
Message
StarkMike
StarkMike
Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)
Group: Forum Members
Posts: 436, Visits: 944
When I am adding a new record how would I specify a default value for this record? Like say for instance when I add a new record I want the Created field to be set with the current date. I'm assuming this is something that would be done in the business object just not sure where or how.
Reply
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Within the main code file, you should have a handler for [BOName]_SetDefaultValues(). This event is raised whenever a new record is added to a business object, so within it, add the line "Me.Created = DateTime.Now" and that will do the trick. You can also set any other default values you need to, and you can pull the default values in whatever means necessary. For instance, in several cases, we have the default values stored off as "soft" default values within the database (i.e.: the end user can set the default City for new customer records, and when you set the default values, you can pull the default value for City from the business object containing the default values).
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search