Brian Freytag
04/26/2019, 2:36 PM{
"code": "INSUFFICIENTPERMISSION",
"message": "You do not have permissions to set a value for element lastmodifieddate due to one of the following reasons: 1) The field is read-only; 2) An associated feature is disabled; 3) The field is available either when a record is created or updated, but not in both cases.",
"type": "ERROR"
}
I'm not updating that value:
if ($netsuiteEmployee->email !== $employee->getEmail()) {
$netsuiteEmployee->email = $employee->getEmail();
}
if ($netsuiteEmployee->firstName !== $employee->getFirstName()) {
$netsuiteEmployee->firstName = $employee->getFirstName();
}
if ($netsuiteEmployee->lastName !== $employee->getLastName()) {
$netsuiteEmployee->lastName = $employee->getLastName();
}
if ($netsuiteEmployee->mobilePhone !== $employeeCell) {
$netsuiteEmployee->mobilePhone = $employeeCell ?: null;
}
if ($netsuiteEmployee->isSalesRep !== $employee->hasRole('ROLE_LEDMS_ROLE_2')) {
$netsuiteEmployee->isSalesRep = $employee->hasRole('ROLE_LEDMS_ROLE_2');
}
if ($netsuiteEmployee->isInactive === $employee->getIsActive()) {
$netsuiteEmployee->isInactive = !$employee->getIsActive();
}
if ($netsuiteEmployee->entityId !== $employee->getFullName()) {
$netsuiteEmployee->entityId = $employee->getFullName();
}
$request = new UpdateRequest();
$request->record = $netsuiteEmployee;
$response = $this->netSuite->update($request);