Update extrafield parameters

Hello.

I’d like to know if it’s possible to update an existent extrafield when I enable a new module. Per example:

I have this extrafield from a module:

$param101 = array();
$sql101 = ‘c_stores_company:label:rowid:: active = 1’;
$param101[‘options’][$sql101] = ‘’;

$extra = $extrafields->addExtraField(‘fk_store’, “Store”, ‘sellist’, 101, ‘’, ‘commande’, 0, 0, ‘’, $param101, 0, ‘’, 1, 0, ‘’, ‘’, ‘stores@stores’, ‘’);

So, from another module to complement I got the same extrafield but table to get data will be a new one like this:

$param101 = array();
$sql101 = 'online_ecommerce:label:rowid:: entity = ’ . $conf->entity;
$param101[‘options’][$sql101] = ‘’;

$extra = $extrafields->addExtraField(‘fk_store’, “Store”, ‘sellist’, 101, ‘’, ‘commande’, 0, 0, ‘’, $param101, 0, ‘’, 1, 0, ‘’, ‘’, ‘online@online’, ‘’);

So when I enable this module I want param value in llx_extrafields update with the new value. But I cannot make it works.

Any idea?

thanks.

What if you delete that extrafield and replace it using the same name but a new configuration?

Thanks for your suggestion. But what I want is update extrafield param when I enable or disable an specific module.

It’s been a few weeks since I created these merge requests, but I seem to remember that there was a function that handled extrafields. And I don’t remember which file it was in, but maybe if you use that function - which I as far as I remember does an update by deleting the old and creating a new.