# Fix for INVALID_ID_ATTRIBUTE: Id specified is incorrect error in Vtiger CRM
## Option 1: Modify
include\Webservices\Utils.php
Replace the
vtws_getIdComponents function with the following:
php
function vtws_getIdComponents($elementid){
return explode("x", $elementid);
}
## Option 2: Modify
include\Webservices\LineItem\VtigerInventoryOperation.php
In the
constructFocusObject method, add a conditional check for
id:
### Original:
php
public function constructFocusObject($element) {
$focus = CRMEntity::getInstance($this->getMeta()->getTabName());
$fields = $focus->column_fields;
foreach ($fields as $fieldName => $fieldValue) {
$fieldValue = $element[$fieldName];
if (is_array($fieldValue)) {
$focus->column_fields[$fieldName] = $fieldValue;
} else if ($fieldValue !== null) {
$focus->column_fields[$fieldName] = decode_html($fieldValue);
}
}
$ids = vtws_getIdComponents($element['id']);
$focus->id = $ids[1];
return $focus;
}
### Updated:
php
public function constructFocusObject($element) {
$focus = CRMEntity::getInstance($this->getMeta()->getTabName());
$fields = $focus->column_fields;
foreach ($fields as $fieldName => $fieldValue) {
$fieldValue = $element[$fieldName];
if (is_array($fieldValue)) {
$focus->column_fields[$fieldName] = $fieldValue;
} else if ($fieldValue !== null) {
$focus->column_fields[$fieldName] = decode_html($fieldValue);
}
}
if ($element['id']) {
$ids = vtws_getIdComponents($element['id']);
$focus->id = $ids[1];
}
return $focus;
}