Hello,
for a Customer Project we would like to create a BusinessPartner with Role Person. Each Person has to be Contact Person for an Account. When creating a Business Partner (Person) with a Before-Save-Script: How can I assign the Account to the Person?
I tried (which is not working):
var newBP : elementsof BusinessPartner;
newBP.CategoryCode = "1";
var newBusinessPartner= BusinessPartner.Create(newBP);
newBusinessPartner.CurrentCommon.Person.Name.GivenName = "ExampleGivenName";
newBusinessPartner.CurrentCommon.Person.Name.FamilyName = "ExampleFamiliyName";
newBusinessPartner.Activate();
var account : elementsof BusinessPartner.Relationship;
account.RelationshipBusinessPartnerInternalID = "1000495";
account.RoleCode.content = "BUR001-2";
var newRelationship = newBusinessPartner.Relationship.Create(account);
Thank you very much in advance & best regards,
Henning