Greetings Everyone,
I have hit a brick wall and need your help please.
Context:
- using the CDS integration, I create contacts in BC coming from the CDS
- BC refuses to create contacts if they do not have a parentcustomerid in the cds (you can find it here: CRMIntTableSubscriber.Codeunit.al, line 499
- a big chunk of our contacts dont have, and wont have a parentcustomerid in the cds
I am trying to intercept the record in an event so that I can fill in a general parentcustomerid to make the system happy, but I cannot seem to catch it to do that, it is driving me nuts for hours.
I have tried :
- OnFindUnCoupledDestinationRecord
- OnBeforeTransferRecordFields
With something like:
if (SourceRecordRef.Number() = Database::"CRM Contact") then begin
SourceRecordRef.SetTable(cdsrec);
cdsrec.ParentCustomerId := 'MY-GUID';
end;
But it is simply ignored, and returns the eternally taunting:
The contact cannot be created because the company does not exist.
Please, any advice on how to get around this silly block?
Cheers