<div dir="ltr"><div>I created the module with the free module builder extension from 
technokrafts (<a href="https://www.technokrafts.com/technokrafts-shop/vtiger-crm-addons/vtiger-module-builder/">https://www.technokrafts.com/technokrafts-shop/vtiger-crm-addons/vtiger-module-builder/</a>).</div><div>And then import the .zip file into admin part of Vtiger.</div><div>How can I fix it now without creation of a new module?<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 16 août 2022 à 10:04, Martin Allen <<a href="mailto:martin.allen@exe-squared.co.uk">martin.allen@exe-squared.co.uk</a>> a écrit :<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 style="overflow-wrap: break-word;" lang="EN-GB">
<div class="gmail-m_-327343369124857316WordSection1">
<p class="MsoNormal"><span>If your creating your module using vtlib then you can set an entityname field during the creation using the setEntityIdentifier() function in vtlib/Vtiger/Module.php<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>    $module = new Vtiger_Module();<u></u><u></u></span></p>
<p class="MsoNormal"><span>    $module->name = $MODULENAME;<u></u><u></u></span></p>
<p class="MsoNormal"><span>    $module->parent= $PARENT;<u></u><u></u></span></p>
<p class="MsoNormal"><span>    $module->save();<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>    $module->initTables();<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>    $block = new Vtiger_Block();<u></u><u></u></span></p>
<p class="MsoNormal"><span>    $block->label = 'LBL_MessageBoard_Information';<u></u><u></u></span></p>
<p class="MsoNormal"><span>    $module->addBlock($block);<u></u><u></u></span></p>
<p class="MsoNormal"><span>    <u></u><u></u></span></p>
<p class="MsoNormal"><span>    $field1  = new Vtiger_Field();<u></u><u></u></span></p>
<p class="MsoNormal"><span>    $field1->name = $ENTITYNAME;<u></u><u></u></span></p>
<p class="MsoNormal"><span>    $field1->label= $ENTITYLABEL;<u></u><u></u></span></p>
<p class="MsoNormal"><span>    $field1->uitype= 2;<u></u><u></u></span></p>
<p class="MsoNormal"><span>    $field1->column = $field1->name;<u></u><u></u></span></p>
<p class="MsoNormal"><span>    $field1->columntype = 'VARCHAR(255)';<u></u><u></u></span></p>
<p class="MsoNormal"><span>    $field1->typeofdata = 'V~M';<u></u><u></u></span></p>
<p class="MsoNormal"><span>    $block->addField($field1);<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<p class="MsoNormal"><span>    $module->setEntityIdentifier($field1);
<u></u><u></u></span></p>
<p class="MsoNormal"><span><u></u> <u></u></span></p>
<div style="border-color:rgb(225,225,225) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Arnaud <<a href="mailto:johnthe5th@gmail.com" target="_blank">johnthe5th@gmail.com</a>>
<br>
<b>Sent:</b> 16 August 2022 08:55<br>
<b>To:</b> Martin Allen <<a href="mailto:martin.allen@exe-squared.co.uk" target="_blank">martin.allen@exe-squared.co.uk</a>>; <a href="mailto:vtigercrm-developers@lists.vtigercrm.com" target="_blank">vtigercrm-developers@lists.vtigercrm.com</a><br>
<b>Subject:</b> Re: [Vtigercrm-developers] UItype 10 field stay blank when use VGS Related Field Generator<u></u><u></u></span></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Martin,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Ok understood, I think you're right. Passing to SQL debug to see the query, I saw "<b>SELECT fieldname, tablename, enityfield FROM vtiger_entityname WHERE tabid = '63'"</b>. From scratch there is no entry.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">That means for me, my custom module is not correctly registered into vtiger_entityname. So I tried to insert it by myself manually  :<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">tabid = 63<br>
modulename = Numerosda<br>
tablename = vtiger_numerosda<br>
fieldname = numerosdano (also tried to put numerosdaid)<br>
entityidfield = numerosdaid<br>
entityidcolumn = numerosdaid <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">But It doesn't work. Is there a clever / better way to insert into this table ?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">What can I check now ?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">Many thanks.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Le ven. 12 août 2022 à 11:58, Martin Allen <<a href="mailto:martin.allen@exe-squared.co.uk" target="_blank">martin.allen@exe-squared.co.uk</a>> a écrit :<u></u><u></u></p>
</div>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal">The fact that your field still shows ‘tapez pour rechercher’ would indicate that it hasn’t picked up the relationship at all – if it were showing a blank value, you wouldn’t see
 this text (we’ve had that issue before). And also your not getting the ‘x’ button to remove the relationship, which only shows if the relationship has been set – this leads me to believe the relationship is NOT being set at all.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div style="border-style:solid none none;border-width:1pt medium medium;padding:3pt 0cm 0cm;border-color:currentcolor">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Arnaud <<a href="mailto:johnthe5th@gmail.com" target="_blank">johnthe5th@gmail.com</a>>
<br>
<b>Sent:</b> 12 August 2022 10:10<br>
<b>To:</b> Martin Allen <<a href="mailto:martin.allen@exe-squared.co.uk" target="_blank">martin.allen@exe-squared.co.uk</a>>;
<a href="mailto:vtigercrm-developers@lists.vtigercrm.com" target="_blank">vtigercrm-developers@lists.vtigercrm.com</a><br>
<b>Subject:</b> Re: [Vtigercrm-developers] UItype 10 field stay blank when use VGS Related Field Generator</span><u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Martin, I tried adding the entry but that didn't help me.
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Are you sure my problem can come from this table?
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Maybe I misspoke to explain the problem, it looks like more a javascript problem.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">I made a screenshot for better understanding :
<a href="https://i.ibb.co/7bR96sQ/vtiger-problem.png" target="_blank">https://i.ibb.co/7bR96sQ/vtiger-problem.png</a><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">The problem occurs before clicking on save and therefore before any addition to the database. There is no javascript error in the console.<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Le ven. 12 août 2022 à 09:32, Martin Allen <<a href="mailto:martin.allen@exe-squared.co.uk" target="_blank">martin.allen@exe-squared.co.uk</a>> a écrit :<u></u><u></u></p>
</div>
<blockquote style="border-style:none none none solid;border-width:medium medium medium 1pt;padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt;border-color:currentcolor currentcolor currentcolor rgb(204,204,204)">
<div>
<div>
<p class="MsoNormal">Also check the value for the record in vtiger_crmentity in the label column – if I remember correctly it will use the details from vtiger_entityname to populate the correct value
 in vtiger_crmentity.label. So if you had no entry in vtiger_entityname for your module when the record was created, then it won’t have a value in this column. Any new record should be populated with a value since you put the entry into vtiger_entityname.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div style="border-style:solid none none;border-width:1pt medium medium;padding:3pt 0cm 0cm;border-color:currentcolor">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US">
<a href="mailto:vtigercrm-developers-bounces@lists.vtigercrm.com" target="_blank">
vtigercrm-developers-bounces@lists.vtigercrm.com</a> <<a href="mailto:vtigercrm-developers-bounces@lists.vtigercrm.com" target="_blank">vtigercrm-developers-bounces@lists.vtigercrm.com</a>>
<b>On Behalf Of </b>Martin Allen<br>
<b>Sent:</b> 11 August 2022 16:23<br>
<b>To:</b> Arnaud <<a href="mailto:johnthe5th@gmail.com" target="_blank">johnthe5th@gmail.com</a>>;
<a href="mailto:vtigercrm-developers@lists.vtigercrm.com" target="_blank">vtigercrm-developers@lists.vtigercrm.com</a><br>
<b>Subject:</b> Re: [Vtigercrm-developers] UItype 10 field stay blank when use VGS Related Field Generator</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">It will be in vtiger_entityname database table.<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">It records the module (by tabid and module name), the db table (tablename)  and id field name and column (so it know how to look up the correct record in the table), and then fieldname,
 which is the actual entity name field. It’s the value of this field that would be shown in a related field to that particular record.
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div style="border-style:solid none none;border-width:1pt medium medium;padding:3pt 0cm 0cm;border-color:currentcolor">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Arnaud <<a href="mailto:johnthe5th@gmail.com" target="_blank">johnthe5th@gmail.com</a>>
<br>
<b>Sent:</b> 11 August 2022 15:54<br>
<b>To:</b> <a href="mailto:vtigercrm-developers@lists.vtigercrm.com" target="_blank">
vtigercrm-developers@lists.vtigercrm.com</a>; Martin Allen <<a href="mailto:martin.allen@exe-squared.co.uk" target="_blank">martin.allen@exe-squared.co.uk</a>><br>
<b>Subject:</b> Re: [Vtigercrm-developers] UItype 10 field stay blank when use VGS Related Field Generator</span><u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Hi Martin,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">You mean in Vtiger_fields table ?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Regards,<u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Le jeu. 11 août 2022 à 15:20, Martin Allen <<a href="mailto:martin.allen@exe-squared.co.uk" target="_blank">martin.allen@exe-squared.co.uk</a>> a écrit :<u></u><u></u></p>
</div>
<blockquote style="border-style:none none none solid;border-width:medium medium medium 1pt;padding:0cm 0cm 0cm 6pt;margin:5pt 0cm 5pt 4.8pt;border-color:currentcolor currentcolor currentcolor rgb(204,204,204)">
<div>
<div>
<p class="MsoNormal">What is the entityname field for the module its relating to? If that value is blank for the related record then it will show as blank.
<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<div style="border-style:solid none none;border-width:1pt medium medium;padding:3pt 0cm 0cm;border-color:currentcolor">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US">
<a href="mailto:vtigercrm-developers-bounces@lists.vtigercrm.com" target="_blank">
vtigercrm-developers-bounces@lists.vtigercrm.com</a> <<a href="mailto:vtigercrm-developers-bounces@lists.vtigercrm.com" target="_blank">vtigercrm-developers-bounces@lists.vtigercrm.com</a>>
<b>On Behalf Of </b>Arnaud<br>
<b>Sent:</b> 08 August 2022 10:49<br>
<b>To:</b> <a href="mailto:vtigercrm-developers@lists.vtigercrm.com" target="_blank">
vtigercrm-developers@lists.vtigercrm.com</a><br>
<b>Subject:</b> [Vtigercrm-developers] UItype 10 field stay blank when use VGS Related Field Generator</span><u></u><u></u></p>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p>Hello,<u></u><u></u></p>
<p>UItype 10 field stay blank when use VGS Related Field Generator only on custom module, (with original there is no problem).<br>
I can select entry in the POP when I click on magnifying glass, but once POP UP close, the field stay totally empty.<u></u><u></u></p>
<p>Even if I create manually the field manualy into database instead of using VGS Related Field Generator I have the same problem. This issue is not VGS Related Field Generator relative.<u></u><u></u></p>
<p>Many thanks for your ideas.<u></u><u></u></p>
<p>Regards,<u></u><u></u></p>
<p>Arnaud.<u></u><u></u></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>

</blockquote></div>