Hello, i use beforeSave function to add some default values to my model but only owner_id is set. created_dt is not set and when i create a new model the error appear that "Created Dt cannot be blank.". Why owner_id is set but created_dt is not set by the CDbExpression?
If I’m not mistaken, beforeSave() runs after validation has finished, so validation is happening before the field is populated.
You could remove any validation rules for created_dt if that field is set automatically and cannot be edited by the user. That will at least resolve the error you’re seeing.