CoreBOSBB
Can't get my UI10 field to show up - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Development (https://discussions.corebos.org/forumdisplay.php?fid=18)
+--- Forum: coreBOS Development (https://discussions.corebos.org/forumdisplay.php?fid=4)
+--- Thread: Can't get my UI10 field to show up (/showthread.php?tid=1040)



Can't get my UI10 field to show up - Guido1982 - 04-11-2018

I've added a UI10 field to a block like this:

PHP Code:
        include_once('vtlib/Vtiger/Module.php');
        
$module Vtiger_Module::getInstance('LitigationMatter');
        
$block Vtiger_Block::getInstance('LBL_Parties'$module);
        
        
// Setup the field
        
$field                =    new Vtiger_Field();
        
$field->name        =    'lm_secondclient';
        
$field->label        =    'Eventueel tweede cliĆ«nt';
        
$field->table        =    'vtiger_litigationmatter';
        
$field->column        =    'secondclientid';
        
$field->columntype    =    'INT(11)';
        
$field->uitype        =    10;
        
$field->typeofdata    =    'V~O';
        
$field->sequence    =    5;

        
$block->addField($field);
        
$field->setRelatedModules(array('Accounts')); 

But the field is not showing up. I checked the DB, all seems to be well. When I change the UI type in the DB to 1, the field shows up. The field IS showing up in the 'vtiger_fieldmodulerel' table.


RE: Can't get my UI10 field to show up - joebordes - 04-11-2018

Is accounts module active?

uitype10 will not appear if the module it references is not active.


RE: Can't get my UI10 field to show up - Guido1982 - 04-11-2018

Yes it is. Even more, the same block has another field that is UI10 and references Accounts. I want to create the possibility to relate the record to two accounts.


RE: Can't get my UI10 field to show up - joebordes - 04-11-2018

I don't know. Debug the getBlocks call and the uitype 10 code in include/utils/EditViewUtils.php

I will try to reproduce it


RE: Can't get my UI10 field to show up - Guido1982 - 04-11-2018

Will do, get back to you as soon as I have time


RE: Can't get my UI10 field to show up - joebordes - 04-11-2018

I copied the code above into my coreBOS Law test installation and ran it. All messages are correct.

I created, viewed and edited a LM record with the new field with no problem.


RE: Can't get my UI10 field to show up - Guido1982 - 05-08-2018

I can't figure this out yet... When I change the uitype to 1 in the DB, the field shows up. I turned on debugging and the field DOES show up in the module calls (like getBlocks) but no dice when set to uitype 10. It DOES show up in the layout manager. I must be doing something incredibly stupid but not sure what so far.

Found it, but is was a REALLY weird error. The value in 'fieldmodulerel' was 2146 for this field. But the ACTUAL field id was 2142. Something got messed up during the field creation. I created a cbupdate record that installed multiple fields in one go, maybe I screwed up somewhere but the field ID mapping between vtiger_field and vtiger_fieldmodulerel was set wrong.


RE: Can't get my UI10 field to show up - joebordes - 05-11-2018

thanks for sharing the answer