<div dir="ltr"><div>Hi Sukhdev,</div><div><br></div><div>I worked on this just a few days ago. To add a line item field you have to edit the following files:</div><div><br></div>  - include/utils/EditViewUtils.php # in order to read your field from the DB and show it in DetailView<br>  - include/utils/InventoryUtils.php # in order to save your field into the DB when saving a record<br>  - layouts/v7/modules/Inventory/LineItemsDetail.tpl # to display your field in the DetailView<br>  - layouts/v7/modules/Inventory/partials/LineItemsContent.tpl # to display your field in EditView<br>  - layouts/v7/modules/Inventory/partials/LineItemsEdit.tpl # to display the table header of your field in EditView<div><br></div><div>I should say... it's a pretty common request from clients to add fields to the line items section. It would be great to do it via the Fields Editor.</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Saludos<div><br></div><div>Rubén</div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 21, 2022 at 11:01 AM Sukhdev Mohan <<a href="mailto:s.mohan@myti.it">s.mohan@myti.it</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div>
<div name="messageBodySection">
<div dir="auto">Hi all,<br>
<br>
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. <br>
<br>
It seems that some thing happens in getRecordModelFromRequest() in modules/Vtiger/actions/Save.php<br>
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?</div>
<pre>$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);
   }
}</pre>
<div dir="auto"><br></div>
</div>
<div name="messageSignatureSection"><br>
<div><font color="#C6C6C6"><b><span>Sukhdev Mohan</span></b></font><span></span><br>
<font color="#999999"><b><span>Developer</span></b></font><br></div>
</div>
</div>

_______________________________________________<br>
<a href="http://www.vtiger.com/" rel="noreferrer" target="_blank">http://www.vtiger.com/</a></blockquote></div>