Initial
|
[AttributeUsageAttribute(AttributeTargets.Property)] public sealed class InitialValueScriptAttribute : Attribute
The InitialValueScriptAttribute type exposes the following members.
Name | Description | |
---|---|---|
InitialValueScriptAttribute | Creates a new InitialValueScriptAttribute/ |
Name | Description | |
---|---|---|
InitialValueScript | Gets the initial value expression for a modeled table field. | |
TypeId | When implemented in a derived class, gets a unique identifier for this Attribute. (Inherited from Attribute) |
Name | Description | |
---|---|---|
Equals | Returns a value that indicates whether this instance is equal to a specified object. (Inherited from Attribute) | |
GetHashCode | Returns the hash code for this instance. (Inherited from Attribute) | |
GetType | Gets the Type of the current instance. (Inherited from Object) | |
IsDefaultAttribute | When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. (Inherited from Attribute) | |
Match | When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. (Inherited from Attribute) | |
ToString | Returns a string that represents the current object. (Inherited from Object) |
Name | Description | |
---|---|---|
GetEnumValueOrDefault |
Gets the enumeration constant for value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions) | |
GetEnumValueOrDefaultT |
Gets the enumeration constant for this value, if defined in the enumeration, or a default value.
(Defined by EnumExtensions) |
Example to set initial value to 30 days from now using a Javascript expression: [InitialValueScript("(new Date()).addDays(30)")]
Note that the DefaultValueAttribute should be used to set any constant values for new modeled record instances and the DefaultValueExpressionAttribute should be used for applying any needed server-side run-time expression defaults, either of these will get assigned when using the NewRecord function. The InitialValueScriptAttribute is used to initialize the property value using an expression that gets evaluated in the target environment.