Handle nullable relationship in edit form
I have "Project" and "HumanResource" models.
Each project has a "project manager" and "operational_manager", both belong to "HumanResource" model.
i can create a project without mentionning the project and operational managers.
In this case the "project_manager" and "operational_manager" will be null.
When i don't set those fields i get the error in attachment.
Otherwise, i pass normally.
EditRecord Code :
relationship code in Project model :
Solution:Jump to solution
@toeknee i found the error in the relationship.
instead of using "hasOne" i use "belongsTo" and it works...
3 Replies