Skip to Content
0
May 15, 2020 at 09:32 AM

Setting the Employee ID in Owner Field while creating Account in C4C

405 Views Last edit May 18, 2020 at 04:39 PM 2 rev

Hello Experts,

I have requirement to update the Employee ID of the Logged-On User in the Owner field while creating Accounts.

I have written the below piece of code in Event-after-modify.

varidty = Identity.Retrieve(Context.GetCurrentIdentityUUID());

varemp = Employee.Retrieve(idty.BusinessPartnerUUID);

//take uuid from idty and retrieve employee.

if (idty.IsSet())

{


if (this.EmployeeResponsibleSales.IsSet())

{

this.EmployeeResponsibleSales.EmployeeID = emp.IdentificationEmployeeID.EmployeeID;

}

}

I am getting error while creating the account, when debugged, the error is thrown while reading the object

this.EmployeeResponsibleSales..

Could you please suggest.

Thank you!