The $bean param from this function shows a 'null' case_number value, so I figured I would just grab the id and make another call to retrieve the case bean which you can see below.
However, this STILL results in a null value for the case_number, whilst all the other fields show the correct value.
The case number is clearly there in my cases module, so how is it showing null? Does case_number not get saved until the after_save hook or something? Guidance appreciated!
function after_case_creation($bean, $event, $arguments) {
$module = $bean->module_dir;
$caseId = $bean->id;
$caseBean = BeanFactory::retrieveBean($module, $caseId);
$caseNumber = $caseBean->case_number;
$caseTitle = $caseBean->name;
$caseContent = $caseBean->description;
$caseOwnerId = $caseBean->assigned_user_id;
}