CoreBOSBB
[Solved]Change module reference field - Printable Version

+- CoreBOSBB (https://discussions.corebos.org)
+-- Forum: Support (https://discussions.corebos.org/forumdisplay.php?fid=17)
+--- Forum: User Support (https://discussions.corebos.org/forumdisplay.php?fid=6)
+--- Thread: [Solved]Change module reference field (/showthread.php?tid=2437)



[Solved]Change module reference field - radu - 10-13-2022

Hello,

I would like to change InventoryDetails reference field to something more relevant than the entity's number. It is important especially in the mobile interface where only 1 field is shown in 'listview'.
Any help is appreciated.

Thank you.


RE: Change module reference field - joebordes - 10-13-2022

Hi

Try this article:

https://discussions.corebos.org/documentation/doku.php?id=en:devel:entityidentifier

see if that does the trick

make a backup of the database before trying


RE: Change module reference field - radu - 10-13-2022

Hi Joe,

Thanks for the answer, great article!
I tried it, I can control the listview linkfield from module's php. That way I can turn other fields into links to detailview. But the original number field(entity identifier) is still active as a link and it is still presented in the mobile interface.
I have adapted the script and tried to change the entity identifier to quantity field(in InventoryDetails) for a test. But i must do something wrong because it does not seem to have any effect.
I copied the php script to the root website and I tried running the it from command line then from the browser, pointing at the php script. Is there another procedure to run these scripts?

// Turn on debugging level
$Vtiger_Utils_Log = true;

require_once 'include/utils/utils.php';
include_once('vtlib/Vtiger/Module.php');
require_once('config.inc.php');

$module = Vtiger_Module::getInstance('InventoryDetails');

$module->unsetEntityIdentifier(); // this unset the potentialname like a entity identifeir

$field = VTiger_Field::getInstance('quantity', $module); // now you get the field that you want to entity identifier

$module->setEntityIdentifier($field); // set this field.


RE: Change module reference field - radu - 10-14-2022

It works, it does what I need to!
Stupid mistake, i forgot to put the php markers in the script file... it was not parsing it to php Wink

Thanks for the help!