Default Field Values
Information on default values for non-required fields when creating new records.
Non-Required Fields
When you create a new record, a default value is inserted for any non-required fields with a default value defined in SQL Server.
Default values have no impact on required fields in the Platform.
Example
If you have a field Groups.Target_Size with a default value of 12, MinistryPlatform automatically inserts and saves 12 in the field if you leave it empty when you create a new Group record.
Side Effects
A User sees default values when they open a new record and can change the value before saving. In the previous example, the Group Target_Size would start as 12.
This can be useful for fields that you want to set with a specfic value and not leave blank. If you create custom fields, remember this if you add a default value.
Potential Errors
If a default is defined on a Foreign Key field and the default value doesn't not have a corresponding record in the related table, the following error can result:
Record Corresponding to provided identifier is not found: Parameter name: value
To fix this error, change the default value defined in the database.