[Vtigercrm-developers] Vtlib API and Picklist

Sachin R sachin.r0481 at yahoo.in
Fri Aug 29 07:56:13 GMT 2014


I did not realize I was breaking the convention when I try to use "status" as name of field, even though I figured out picklist works fine as long as I don't use "status" as name of field.

Thanks for clarification. 

Sachin

On Friday, 29 August 2014 12:42 PM, Prasad <prasad at vtiger.com> wrote:



Sachin,

I assume you renamed the picklist field after the creation. If yes, that breaks the convention of fieldname vs picklist table so revert back.

We recommend to prefix modulename for picklist table as you did "terminalstatus" assuming "terminal" to be your module. This will help in creating unique picklist-tables across several module.

Regards,
Prasad


Connect with us on: Twitter I Facebook I Blog I Wiki I Forums I Website


On Fri, Aug 29, 2014 at 8:07 AM, Sachin R <sachin.r0481 at yahoo.in> wrote:

Hi,
>
>I have noticed a strange behavior in "vtlib" picklist API.
>
>For example the following code works fine.
>
>  $field3 = new Vtiger_Field();
>  $field3->name = 'terminalstatus';
>  $field3->label = 'Status';
>  $field3->column = $field3->name;
>  $field3->columntype = 'VARCHAR(50)';
>  $field3->typeofdata = 'V~M';
>  $field3->uitype = 15;
>  $block->addField($field3);
>
>  $field3->setPicklistValues(ARRAY('Active','Inactive'));
>
>if I rename the field as "status", the pick list is not populated in user interface.
>
>Regards,
>
>Sachin
>
>_______________________________________________
>http://www.vtiger.com/
>



More information about the vtigercrm-developers mailing list