NULL
NULL

Reputation: 23

Cannot save some fields like 'Telephone', 'Email', 'Tax',.. of Sales Employee using DI API

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

Answers (2)

Charles Jenkins
Charles Jenkins

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

Praxiom
Praxiom

Reputation: 646

Try using the EmployeesInfo Object:

SAPbobsCOM.EmployeesInfo EmployeeInfo = objCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oEmployeesInfo);
EmployeeInfo.GetByKey("BOB");
EmployeeInfo.Remarks = "Always Late!";

Upvotes: 0

Related Questions