Skip to content
Snippets Groups Projects
Commit 9049e88e authored by Prasad's avatar Prasad
Browse files

Fixes #901: Resolution of reference record by id

parent a60314d0
No related branches found
No related tags found
No related merge requests found
......@@ -64,6 +64,11 @@ class VTCreateEntityTask extends VTTask {
$fieldValueType = $fieldInfo['valuetype'];
$fieldValue = trim($fieldInfo['value']);
$moduleFieldInstance = $moduleFields[$fieldName];
//If field is invisible, then continue
if (!$moduleFieldInstance) {
continue;
}
preg_match('/\((\w+) : \((\w+)\) (\w+)\)/',$fieldValue,$matches);
if ($fieldValueType == 'fieldname') {
$field = $fieldValue;
......@@ -164,7 +169,13 @@ class VTCreateEntityTask extends VTTask {
if ($allowNameToIdEncode) {
$referenceModuleList = $moduleFieldInstance->getReferenceList();
$fieldReferenceModule = $referenceModuleList[0];
$recordId = Vtiger_Util_Helper::getRecordId($fieldValue, $fieldReferenceModule, true);
if (is_numeric($fieldValue) && isRecordExists($fieldValue) && getSalesEntityType($fieldValue) == $fieldReferenceModule) {
$recordId = $fieldValue;
} else {
$recordId = Vtiger_Util_Helper::getRecordId($fieldValue, $fieldReferenceModule, true);
}
if (!empty($recordId)) {
$fieldValue = $recordId;
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment