[Vtigercrm-developers] Saving custom hidden field in Quote line item

Sukhdev Mohan s.mohan at myti.it
Mon Feb 21 16:57:22 GMT 2022


Hi all,

I want to save a hidden input value into vtiger_inventoryproductrel along with the other line item properties. I’ve already crated the field and a the column and followed the naming convention (myvar$row_no) but when I save the value isn’t saved. I’m not understanding where I’m missing.

It seems that some thing happens in getRecordModelFromRequest() in modules/Vtiger/actions/Save.php
This code seems to transfer the the values from the form to the RecordModel but there is no logic for columnName$row_no and all the others properties are being settled correctly. What am I missing?
$fieldModelList = $moduleModel->getFields();
     foreach ($fieldModelList as $fieldName => $fieldModel) {
  $fieldValue = $request->get($fieldName, null);
  $fieldDataType = $fieldModel->getFieldDataType();
  if($fieldDataType == 'time'){
     $fieldValue = Vtiger_Time_UIType::getTimeValueWithSeconds($fieldValue);
  }
  if($fieldValue !== null) {
     if(!is_array($fieldValue) && $fieldDataType != 'currency') {
        $fieldValue = trim($fieldValue);
     }
     $recordModel->set($fieldName, $fieldValue);
  }
}


Sukhdev Mohan
Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20220221/12a99a4e/attachment.html>


More information about the vtigercrm-developers mailing list