Create a helper function for the entity reference field.