Reputation: 23
I want to add (or update) sale employee (database table: OSLP) using DI API. The object to use is SalesPerson, but in its public properties I dont see 'Telephone', 'Mobile', 'Fax',... I just added successfully a record without these properties, it means that I used the correct service (SalesPerson). So how I can add a record with fields like: Telephone, Mobile, ... ? Thanks in advance.
Please check my images for more info:
Upvotes: 1
Views: 557
Reputation: 390
In the OP's graphic, you see the EmployeeID, which is a foreign key to the EmployeesInfo object.
If you have loaded a salesperson record into memory as a SalesPersons object named "oslp", this is how you'd update the mobile phone:
var ohem = company.GetBusinessObject( BoObjectTypes.oEmployeesInfo ) as EmployeesInfo;
if ( ohem.GetByKey( oslp.EmployeeId ) ) {
ohem.MobilePhone = newMobilePhoneNumber;
var errorCode = ohem.Update();
// Deal with error, if any
}
If you hire a new salesperson, you would add the EmployeesInfo first and note the new person's EmployeeId; then add the Salespersons record and fill in the EmployeeId.
Upvotes: 0
Reputation: 646
Try using the EmployeesInfo Object:
SAPbobsCOM.EmployeesInfo EmployeeInfo = objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oEmployeesInfo);
EmployeeInfo.GetByKey("BOB");
EmployeeInfo.Remarks = "Always Late!";
Upvotes: 0