I must create a synchronisation process to import data from a CRM. I have a page reference field where I don't know in advance all the available options. It has to be added in the reference tree.
In my import script, based on Ryan's Import Page by CSV module, i coded this:
$p->crm_member_type = $data['TypeDeMembre'];
where $p is a valid page to be saved. $data['TypeDeMembre'] is a string.
Actually, if the entry is already present in the page reference tree, the data is saved correctly. But if the entry does not exist, nothing is saved.
This page reference field ("crm_member_type") is set to accept new entry on the UI, but I think this feature is not available from API.
Do I have to check first if the entry exists then create a the right page to be referenced afterwards?