Adding Contact Employee by Code doesn't work
Sebastian Schweer
Hi,another problem from me, by adding an Item in SBO.
I try to add a Contact Employee, but it crashed due to the allocation of the variable.
SAPbobsCOM.ContactEmployees oEmployee = (SAPbobsCOM.ContactEmployees) SwissAddonFramework.B1Connector.GetB1Connector().Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oContacts);
This don't work. And i think this is based to the fact, that "oContacts" is not the right allocation. But there are no Point like "oContactEmployees".
Have anybody an idea how i can solve it?
Or does anybody have this problem already solved?
Best regards and a lot of thanks for your help,
Sebastian
Bastian Hofmeister
Hi,take the BusinessPartners-Object.
There are the ContactEmployees, too.
SAPbobsCOM.BusinessPartners oBP = (SAPbobsCOM.BusinessPartners)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners);
oBP.ContactEmployees.Name = "XYZ"; //example
oBP.ContactEmployees.Add(); //example
oBP.Update(); // don't forget!!
hth
Basti
0
Please sign in to leave a comment.
Comments
0 comments