[Vtigercrm-developers] UItype 10 field stay blank when use VGS Related Field Generator
Alan Lord
alanslists at gmail.com
Tue Aug 16 08:02:56 GMT 2022
On 16/08/2022 08:54, Arnaud wrote:
> But It doesn't work. Is there a clever / better way to insert into this
> table ?
If you bootstrapped your module the vtlib APIs, in the Module class is a
method specifically for this purpose:
https://code.vtiger.com/vtiger/vtigercrm/blob/7.4.0GA/vtlib/Vtiger/ModuleBasic.php#L311
e.g.:
> // Payment Number
> $field = Vtiger_Field::getInstance('paymentno', $module);
> if ($field != false) {
> $field->delete();
> }
> $field = new Vtiger_Field();
> $field->name = 'paymentno';
> $field->column = $field->name;
> $field->label = 'Payment No.';
> $field->columntype = 'VARCHAR(100)';
> $field->uitype = 4;
> $field->presence = 0;
> $field->typeofdata = 'V~O';
> $field->summaryfield = 1;
> $block_main->addField($field);
>
> // Set an Entity Idenitfier field
> $module->setEntityIdentifier($field);
> unset($field);
HTH
Al
More information about the vtigercrm-developers
mailing list