Hello Folks,
I am trying to create contact person ID through code.
I did followed this code here from community and replaced ContactPersonEntity of Ax2012 with ContactPersonSyncEntity in D365 and got errors at line of code which I have shared below (please excuse for not using code snippet in the way it is intended to be used).
Please suggest a fix for errors and numseq issue described in below snippet.
ContactPersonSyncEntity contactPersonSyncEntity ;
//Get State not found error at below line of code.
// Update the postal address information.
contactPersonSyncEntity .createOrUpdatePostalAddress(postalAddress);
//When I comment above code to continue with execution next error I get stating contact person id should be there from below line of code.
// Update the contact information.
contactPersonSyncEntity .createOrUpdateContactInfo(contactInfo);
//Which is strange because before this line of code there is the code
contactPersonSyncEntity .parmContactPersonId('CP64');
//Also will be nice f you can share how to get contatPersonId from contactperson number seqeunce sued at legal entity level
Thanks in advance
Mav