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
You'll need to go to the BOMapper and configure the business object. Inside the configuration, select "Single Event for All Fields" for the "Changed Events" type. After rebuilding the partial class for the business object, you'll have a new event called FieldValueChanged. Add a handler to this event (within the business object itself) and within the handler add the line "Me.Modified = DateTime.Now" Whenever you change a field on the business object, it will go through this event and set the "Modified" field to the current time. When you save the record, that fieldl will also be updated back to the server.
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