[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtigercrm-developers
Subject:    [Vtigercrm-developers]  vtlib adding a picklist field
From:       Kevin Alderton <lists.k.j.alderton () gmail ! com>
Date:       2015-07-28 11:57:10
Message-ID: 55B76E16.3040609 () gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

In the vtiger logs I am getting the following:

    INFO VT - PearDatabase ->ADODB error  Query Failed:INSERT INTO
    vtiger_testpicklist (testpicklist id, testpicklist , sortorderid,
    presence) VALUES(?,?,?,?)::->[1064]You have an error in your SQL
    syntax; check the manual that corresponds to your MySQL server
    version for the right syntax to use near 'id, testpicklist ,
    sortorderid, presence) VALUES(0,'Value2',2,1)' at line 1

Is this a bug???????







Hello,

I am having trouble with vtlib and vtiger 6.3.

I am trying to add a picklist field in the Leads module.

All is well except no values are stored in the database nor table 
inserted.  Having tried three new instances of vtiger I am now wondering 
if there has been an alteration in vtlib for 6.x.  It maybe something 
that I am missing.  Has anyone had anything similar?

My code is:

    <?php

    include_once('vtlib/Vtiger/Module.php');
    include_once('vtlib/Vtiger/Utils.php');

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

    $blockInstance =  new vtiger_block();

    $blockInstance->label = 'LBL_TEST_PICKLIST';
    $module ->addBlock($blockInstance);

    $fieldInstance = new Vtiger_Field();
    $fieldInstance->name = 'test_picklist_field ';
    $fieldInstance->label = 'Test Picklist Field';
    $fieldInstance->column = 'test_picklist_field';
    $fieldInstance->columntype = 'VARCHAR(50)';
    $fieldInstance-> table =  $module->basetable;
    $fieldInstance->uitype = 16;
    $fieldInstance->typeofdata = 'V~O';
    $blockInstance->addField($fieldInstance);
    echo "Added field <br />";
    $fieldInstance->setPicklistValues( Array ('Value1', 'Value2') );

    Tia


[Attachment #5 (text/html)]

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi,<br>
    <br>
    In the vtiger logs I am getting the following:<br>
    <blockquote><cite>INFO VT - PearDatabase -&gt;ADODB error  Query
        Failed:INSERT INTO vtiger_testpicklist (testpicklist id,
        testpicklist , sortorderid, presence)
        VALUES(?,?,?,?)::-&gt;[1064]You have an error in your SQL
        syntax; check the manual that corresponds to your MySQL server
        version for the right syntax to use near 'id, testpicklist ,
        sortorderid, presence) VALUES(0,'Value2',2,1)' at line 1<br>
        <br>
      </cite></blockquote>
    <cite>Is this a bug???????</cite><cite></cite><br>
    <cite></cite><br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    Hello,<br>
    <br>
    I am having trouble with vtlib and vtiger 6.3.<br>
    <br>
    I am trying to add a picklist field in the Leads module.  <br>
    <br>
    All is well except no values are stored in the database nor table
    inserted.  Having tried three new instances of vtiger I am now
    wondering if there has been an alteration in vtlib for 6.x.  It
    maybe something that I am missing.  Has anyone had anything similar?<br>
    <br>
    My code is:<br>
    <br>
    <blockquote>&lt;?php<br>
      <br>
      include_once('vtlib/Vtiger/Module.php'); <br>
      include_once('vtlib/Vtiger/Utils.php');<br>
      <br>
      $module = Vtiger_Module::getInstance('Leads'); <br>
      <br>
      $blockInstance =  new vtiger_block();<br>
      <br>
      $blockInstance-&gt;label = 'LBL_TEST_PICKLIST';<br>
      $module -&gt;addBlock($blockInstance);<br>
      <br>
      $fieldInstance = new Vtiger_Field();<br>
      $fieldInstance-&gt;name = 'test_picklist_field '; <br>
      $fieldInstance-&gt;label = 'Test Picklist Field'; <br>
      $fieldInstance-&gt;column = 'test_picklist_field';<br>
      $fieldInstance-&gt;columntype = 'VARCHAR(50)';<br>
      $fieldInstance-&gt; table =  $module-&gt;basetable;<br>
      $fieldInstance-&gt;uitype = 16; <br>
      $fieldInstance-&gt;typeofdata = 'V~O'; <br>
      $blockInstance-&gt;addField($fieldInstance); <br>
      echo "Added field &lt;br /&gt;";<br>
      $fieldInstance-&gt;setPicklistValues( Array ('Value1', 'Value2')
      );<br>
      <br>
      Tia<br>
    </blockquote>
  </body>
</html>


_______________________________________________
http://www.vtiger.com/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic