<div class="gmail_extra">Hi,</div><div class="gmail_extra"><br></div><div class="gmail_extra">In my case, I needed to add javascript and php validation (call me paranoid, but when you throw a system like vtiger to the wolves, you better be prepared for everything lol), so my solution to that was to add jquery and a custom js file to the vtiger&#39;s edit pages renderer files (that solved client side data validation) and I created an event to every module I needed to make server validation before saving (that solved the server side data validation). If you&#39;re not familiar with any of those techniques, I might be able to help you.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Cheers</div><div class="gmail_extra"><br></div><div class="gmail_extra">Nicolas<br><br><div class="gmail_quote">2012/4/25 raymondub <span dir="ltr">&lt;<a href="mailto:eltroll@gmail.com" target="_blank">eltroll@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi<br>
<br>
do you know how i could to implement custom validation for the fields in<br>
vtiger.<br>
<br>
For example: The length of a field must be max 30 characters<br>
I understand that for that i ll have to work with the<br>
vtiger_field.typeofdata..<br>
Cause i m sure that it s possible to make, it s already implemented with the<br>
email in contacts. If there s no @ that the email is not valid. I was not<br>
able to find the place of that check.<br>
<br>
thanks in advance,<br>
<br>
Pat<br>
<br>
<br>
Holbok István wrote:<br>
&gt;<br>
&gt; Dear All,<br>
&gt;<br>
&gt; I was a little bit confused with the issue of UITYPE and TYPEOFDATA, so<br>
&gt; I did a small map how UITYPE, TYPEOFDATA and SQL data type relate to<br>
&gt; each other.<br>
&gt;<br>
&gt; This map in the form of HTML table is here.<br>
&gt; The sign &#39;???&#39; means - I do not understand why that typeofdata was used.<br>
&gt;<br>
&gt; This table uses the data from <a href="http://wiki.vtiger.com/index.php/Ui_types" target="_blank">http://wiki.vtiger.com/index.php/Ui_types</a><br>
&gt; also.<br>
&gt;<br>
&gt; Best regards:<br>
&gt;<br>
&gt; István Holbok<br>
&gt; Phone: <a href="tel:%2B3670-342-0900" value="+36703420900">+3670-342-0900</a><br>
&gt; e-mail: <a href="mailto:holbok@gmail.com">holbok@gmail.com</a> &lt;mailto:<a href="mailto:holbok@gmail.com">holbok@gmail.com</a>&gt;<br>
&gt;<br>
&gt; A solution for the Gulf Coast cleanup: HARDOIL<br>
&gt; Watch the video: <a href="http://environmental-us.com/hardoil/en/video.html" target="_blank">http://environmental-us.com/hardoil/en/video.html</a><br>
&gt;<br>
&gt; GENERATED VTIGER CRM UITYPE, TYPE of DATA and SQL Data/Column Type on<br>
&gt; Custom Field Settings<br>
&gt; Field type on custom field settings   Length  Decimal places  (Generated)<br>
&gt; uitype        (Generated) typeofdata  (Generated) SQL Column Type     Mandatory<br>
&gt; Text  100     ---     1       V~O~LE~100      varchar(100)    No<br>
&gt; Text  100     ---     1       V~M~LE~100      varchar(100)    YES<br>
&gt; Text  25      ---     1       V~O~LE~25       varchar(25)     No<br>
&gt; Text  25      ---     1       V~M~LE~25       varchar(25)     YES<br>
&gt; Number (float)        10      0       7       NN~O~10,0       decimal(11,0)   No<br>
&gt; Number (float)        10      0       7       NN~M~10,0       decimal(11,0)   YES<br>
&gt; Number (float)        7       3       7       NN~O~7,3        decimal(11,3)   No<br>
&gt; Number (float)        7       3       7       NN~M~7,3        decimal(11,3)   YES<br>
&gt; Percent %     ---     ---     9       N~O~2~2         decimal(5,2)    No<br>
&gt; Percent %     ---     ---     9       N~M~2~2         decimal(5,2)    YES<br>
&gt; Currency      10      2       71      N~O~10,2        decimal(13,2)   No<br>
&gt; Currency      10      0       71      N~M~10,0        decimal(11,0)   YES<br>
&gt; Date  ---     ---     5       D~O     date    No<br>
&gt; Date  ---     ---     5       D~M     date    YES<br>
&gt; Email         ---     ---     13      E~O     varchar(50)     No<br>
&gt; Email         ---     ---     13      E~M     varchar(50)     YES<br>
&gt; Phone         ---     ---     11      V~O     varchar(30)     No<br>
&gt; Phone         ---     ---     11      V~M     varchar(30)     YES<br>
&gt; Pick List (Value 1, Value 2, etc.)    ---     ---     15      V~O     varchar(255)    No<br>
&gt; Pick List     ---     ---     15      V~M     varchar(255)    YES<br>
&gt; URL   ---     ---     17      V~O     varchar(255)    No<br>
&gt; URL   ---     ---     17      V~M     varchar(255)    YES<br>
&gt; Checkbox      ---     ---     56      C~O     varchar(3)      No<br>
&gt; Checkbox      ---     ---     56      C~M     varchar(3)      YES<br>
&gt; Text Area     ---     ---     21      V~O     text    No<br>
&gt; Text Area     ---     ---     21      V~M     text    YES<br>
&gt; Multi Select Combo Box        ---     ---     33      V~O     text    No<br>
&gt; Multi Select Combo Box        ---     ---     33      V~M     text    YES<br>
&gt; SkyPe ID      ---     ---     85      V~O     varchar(255)    No<br>
&gt; SkyPe ID      ---     ---     85      V~M     varchar(255)    YES<br>
&gt; EXISTING VTIGER (5.x) CRM UITYPE, TYPE of DATA and SQL Data/Column Type<br>
&gt; on the SQL tables: vtiger_field &amp; module tables, e.g. vtiger_leaddetails<br>
&gt; &amp; others<br>
&gt; Example Column-name / table   Fieldname       Fieldlabel      UITYPE  TYPEOFDATA<br>
&gt; SQL column type       Mandatory<br>
&gt; Text box<br>
&gt; tickersymbol / vtiger_account         tickersymbol    Ticker Symbol   1       V~O<br>
&gt; varchar(30)   No<br>
&gt; noofemployees / vtiger_leaddetails    noofemployees   No Of Employees         1<br>
&gt;       I~O (??? text)  int(50)         No<br>
&gt; qtyinstock / vtiger_products  qtyinstock      Qty In Stock    1<br>
&gt;       NN~O (??? text)         decimal(25,3)   No<br>
&gt; qty_per_unit / vtiger_service         qty_per_unit    No of Units     1<br>
&gt;       N~O (??? text)  decimal(11,2)   No<br>
&gt; subject / vtiger_servicecontracts     subject         Subject         1       V~M<br>
&gt; varchar(100)  YES<br>
&gt; Text box, mandatory entry<br>
&gt; time_start / vtiger_activity  time_start      Time Start      2       T~M<br>
&gt; varchar(50)   YES<br>
&gt; time_end / vtiger_activity    time_end        End Time        2       T~O     varchar(50)     No<br>
&gt; accountname / vtiger_account  accountname     Account Name    2       V~M<br>
&gt; varchar(100)  YES<br>
&gt; activitytype / vtiger_activity        activitytype    Activtiy Type   2       V~O<br>
&gt; varchar(200)  No<br>
&gt; Text box with Inheritance<br>
&gt; accesskey / vtiger_users      accesskey       Webservice Access Key   3       V~O<br>
&gt; varchar(36)   No<br>
&gt; Text box with Inheritance, mandatory entry<br>
&gt; account_no / vtiger_account   account_no      Account No      4       V~O<br>
&gt; varchar(100)  No<br>
&gt; Date<br>
&gt; enddate / vtiger_projecttask  enddate         End Date        5<br>
&gt; D~0~OTH~GE~startdate~Start Date<br>
&gt; [0 Null is a possible typo]<br>
&gt;       date    No<br>
&gt; dateinservice / vtiger_assets         dateinservice   Date in Service         5<br>
&gt; D~M~OTH~GE~dateinservice~Date in Service      date    YES<br>
&gt; datesold / vtiger_assets      datesold        Date Sold       5<br>
&gt; D~M~OTH~GE~datesold~Date Sold         date    YES<br>
&gt; sales_start_date / vtiger_service     sales_start_date        Sales Start<br>
&gt; Date  5       D~O     date    No<br>
&gt; sales_end_date / vtiger_service       sales_end_date  Sales End Date  5<br>
&gt; D~O~OTH~GE~sales_start_date~Sales Start Date  date    No<br>
&gt; expiry_date / vtiger_service  expiry_date     Support Expiry Date     5<br>
&gt; D~O~OTH~GE~start_date~Start Date      date    No<br>
&gt; support_end_date / vtiger_customerdetails     support_end_date        Support End<br>
&gt; Date  5       D~O~OTH~GE~support_start_date~Support Start Date        date    No<br>
&gt; end_period / vtiger_invoice_recurring_info    end_period      End Period      5<br>
&gt; D~O~OTH~G~start_period~Start Period   date    No<br>
&gt; Date, default to currenttime<br>
&gt; date_start / vtiger_activity  date_start      Start Date &amp; Time       6<br>
&gt; DT~M~time_start       date    YES<br>
&gt; date_start / vtiger_activity  date_start      Date &amp; Time Sent        6<br>
&gt; DT~M~time_start~Time Start    date    YES<br>
&gt; Number box<br>
&gt; employees / vtiger_account    employees       Employees       7       I~O     int(10)         No<br>
&gt; total_units / vtiger_servicecontracts         total_units     Total Units     7<br>
&gt; V~O   decimal(5,2)    No<br>
&gt; json encoded string<br>
&gt; to_email / vtiger_emaildetails        saved_toid      To      8       V~M     text    YES<br>
&gt; cc_email / vtiger_emaildetails        ccemail         Cc      8       V~O     text    No<br>
&gt; Percent<br>
&gt; probability / vtiger_potential        probability     Probability     9       N~O<br>
&gt; decimal(7,3)  No<br>
&gt; progress / vtiger_servicecontracts    progress        Progress        9       N~O~2~2<br>
&gt; decimal(5,2)  No<br>
&gt; general relate field, for relating entities<br>
&gt; sc_related_to / vtiger_servicecontracts       sc_related_to   Related to<br>
&gt; 10    V~O     int(11)         No<br>
&gt; product / vtiger_assets       product         Product Name    10      V~M     int(19)         YES<br>
&gt; Phone<br>
&gt; phone / vtiger_account        phone   Phone   11      V~O     varchar(30)     No<br>
&gt; OrgUnit pickbox  / Organization multiselect pickbox<br>
&gt; from_email / vtiger_emaildetails      from_email      From    12      V~M<br>
&gt; varchar(50)   YES<br>
&gt; EMail<br>
&gt; email / vtiger_contactdetails         email   Email   13      E~O     varchar(100)    No<br>
&gt; Picklist<br>
&gt; activitytype / vtiger_activity        activitytype    Activity Type   15      V~M<br>
&gt; varchar(200)  YES<br>
&gt; industry / vtiger_account     industry        industry        15      V~O     varchar(200)    No<br>
&gt; Picklist, mandatory entry  ???<br>
&gt; recurringtype / vtiger_activity       recurringtype   Recurrence      16      O~O<br>
&gt; varchar(200)  No<br>
&gt; duration_minutes / vtiger_activity    duration_minutes        Duration<br>
&gt; Minutes       16      T~O     varchar(200)    No<br>
&gt; reminder_interval / vtiger_users      reminder_interval       Reminder<br>
&gt; Interval      16      V~O     varchar(100)    No<br>
&gt; URL<br>
&gt; website  / vtiger_account     website         Website         17      V~O     varchar(100)    No<br>
&gt; Textarea with colspan=2<br>
&gt; commentcontent / vtiger_modcomments   commentcontent  Comment         19<br>
&gt; V~M   text    YES<br>
&gt; description / vtiger_crmentity        description     Description     19      V~O     text<br>
&gt; No<br>
&gt; Textarea with colspan=2, mandatory entry<br>
&gt; question / vtiger_faq         question        Question        20      V~M     text    YES<br>
&gt; Textarea<br>
&gt; message / vtiger_smsnotifier  message         message         21      V~M     text    YES<br>
&gt; bill_street / vtiger_accountbillads   bill_street     Billing Address<br>
&gt; 21    V~O     varchar(250)    No<br>
&gt; Textarea, mandatory entry<br>
&gt; title / vtiger_troubletickets         ticket_title    Title   22      V~M<br>
&gt; varchar(255)  YES<br>
&gt; Date<br>
&gt; closingdate / vtiger_potential        closingdate     Expected Close Date     23<br>
&gt; D~M   date    YES<br>
&gt; due_date / vtiger_activity    due_date        Due Date        23<br>
&gt; D~M~OTH~GE~date_start~Start Date &amp; Time       date    YES<br>
&gt; due_date / vtiger_servicecontracts    due_date        Due Date        23      D~O     date    No<br>
&gt; targetenddate / vtiger_project        targetenddate   Target End Date         23<br>
&gt; D~0~OTH~GE~startdate~Start Date<br>
&gt; [0 Null is a possible typo]<br>
&gt;       date    No<br>
&gt; Textarea, mandatory entry<br>
&gt; bill_street / vtiger_quotesbillads    bill_street     Billing Address         24<br>
&gt; V~M   varchar(250)    YES<br>
&gt; 25, 26, 27,28 ??? missing entries at<br>
&gt; <a href="http://wiki.vtiger.com/index.php/Ui_types" target="_blank">http://wiki.vtiger.com/index.php/Ui_types</a><br>
&gt; access_count /  vtiger_email_track    access_count    Access Count    25<br>
&gt; V~O   int(11)         No<br>
&gt; folderid / vtiger_notes       folderid        Folder Name     26      V~O     int(19)         No<br>
&gt; filelocationtype / vtiger_notes       filelocationtype        Download Type   27<br>
&gt; V~O   varchar(5)      No<br>
&gt; filename / vtiger_notes       filename        File Name       28      V~O     varchar(200)    No<br>
&gt; Time left<br>
&gt; reminder_time / vtiger_activity_reminder      reminder_time   Send<br>
&gt; Reminder      30      I~O     int(11)         No<br>
&gt; No sample for UITYPE 31-50 in the SQL table: vtiger_field<br>
&gt; Popup select box for account and contact addresses<br>
&gt; accountid / vtiger_contactdetails     accountid       Account Name    51      I~O<br>
&gt; int(19)       No<br>
&gt; Picklist for username entries<br>
&gt; handler / vtiger_service      assigned_user_id        Owner   52      I~O     int(11)         No<br>
&gt; smcreatorid / vtiger_crmentity        creator         Creator         52      V~O     int(19)         No<br>
&gt; User picklist<br>
&gt; smownerid / vtiger_crmentity  assigned_user_id        Assigned To     53      V~M<br>
&gt; int(19)       YES<br>
&gt; Salutation type picklist<br>
&gt; salutation / vtiger_leaddetails       salutationtype  Salutation      55      V~O<br>
&gt; varchar(200)  No<br>
&gt; firstname / vtiger_leaddetails        firstname       First Name      55      V~O<br>
&gt; varchar(40)   No<br>
&gt; Salutation (for last name)<br>
&gt; lastname / vtiger_leaddetails         lastname        Last Name       255     V~M<br>
&gt; varchar(80)   YES<br>
&gt; Checkbox<br>
&gt; donotcall / vtiger_contactdetails     donotcall       Do Not Call     56      C~O<br>
&gt; varchar(3)    No<br>
&gt; discontinued / vtiger_products        discontinued    Product Active  56      V~O<br>
&gt; int(1)        No<br>
&gt; Contacts popup select box<br>
&gt; contactid / vtiger_salesorder         contact_id      Contact Name    57      I~O<br>
&gt; int(19)       No<br>
&gt; Campaign popup select box<br>
&gt; campaignid / vtiger_potential         campaignid      Campaign Source         58      N~O<br>
&gt; int(19)       No<br>
&gt; Product non-editable capture, popup picklist<br>
&gt; product_id / vtiger_campaign  product_id      Product         59      I~O     int(19)         No<br>
&gt; Attachments, file selection box<br>
&gt; name / vtiger_attachments     filename        Attachment      61      V~O     varchar(255)    No<br>
&gt; Duration minutes picklist - different typeofdata for the tab_id: 9 and<br>
&gt; 16 ???<br>
&gt; duration_hours / vtiger_activity (16)         duration_hours  Duration        63<br>
&gt; I~M   varchar(200)    No<br>
&gt; duration_hours / vtiger_activity (9)  duration_hours  Duration        63<br>
&gt; T~O   varchar(200)    No<br>
&gt; Names out of entities popup picklist<br>
&gt; crmid / vtiger_seactivityrel  parent_id       Related To      66      I~O     int(19)         No<br>
&gt; Names out of entities popup picklist<br>
&gt; parent_id / vtiger_troubletickets     parent_id       Related To      68      I~O<br>
&gt; varchar(100)  No<br>
&gt; Products attachments<br>
&gt; imagename / vtiger_products   vtiger_products         Product Image   69      V~O<br>
&gt; text  No<br>
&gt; Date (for the created and modified date &amp; time)<br>
&gt; createdtime / vtiger_crmentity        createdtime     Created Time    70      T~O<br>
&gt; datetime      No<br>
&gt; createdtime / vtiger_crmentity        createdtime     Created Time    70      V~O (???<br>
&gt; for tab_id: 32 - ServiceContracts)    datetime        No<br>
&gt; Currency<br>
&gt; annualrevenue /  vtiger_account       annual_revenue  Annual Revenue  71<br>
&gt; I~O   int(19)         No<br>
&gt; unit_price / vtiger_service   unit_price      Price   71      N~O     decimal(25,2)   No<br>
&gt; Popup select box for Accounts, mandatory entry [Calls JS function to<br>
&gt; auto fill billing and shipping address fields. Contact pop-up limited to<br>
&gt; only contacts related to the selected Account]<br>
&gt; accountid / vtiger_quotes     account_id      Account Name    73      I~M     int(19)         YES<br>
&gt; Vendor name<br>
&gt; vendor_id / vtiger_products   vendor_id       Vendor Name     75      I~O     int(11)         No<br>
&gt; Potential popup picklist<br>
&gt; potentialid / vtiger_quotes   potential_id    Potential Name  76      I~O<br>
&gt; int(19)       No<br>
&gt; Picklist for secondary username entries<br>
&gt; inventorymanager / vtiger_quotes      assigned_user_id1       Inventory<br>
&gt; Manager       77      I~O     int(19)         No<br>
&gt; Quote popup picklist<br>
&gt; quoteid / vtiger_salesorder   quote_id        Quote Name      78      I~O     int(19)         No<br>
&gt; Sales order popup picklist<br>
&gt; salesorderid / vtiger_invoice         salesorder_id   Sales Order     80      I~O<br>
&gt; int(19)       No<br>
&gt; Vendor name, mandatory entry<br>
&gt; vendorid / vtiger_purchaseorder       vendor_id       Vendor Name     81      I~M<br>
&gt; int(19)       YES<br>
&gt; Tax in Inventory<br>
&gt; taxclass / vtiger_products    taxclass        Tax Class       83      V~O     varchar(200)    No<br>
&gt; Role name popup picklist, mandatory entry<br>
&gt; roleid / vtiger_user2role     roleid  Role    98      V~M     varchar(255)    YES<br>
&gt; Password, mandatory entry<br>
&gt; user_password / vtiger_users  user_password   Password        99      P~M<br>
&gt; varchar(30)   YES<br>
&gt; User capture popup picklist<br>
&gt; reports_to_id / vtiger_users  reports_to_id   Reports To      101     V~O<br>
&gt; varchar(36)   No<br>
&gt; EMail, mandatory entry<br>
&gt; email1 / vtiger_users         email1  Email   104     E~M     varchar(100)    YES<br>
&gt; User image<br>
&gt; imagename / vtiger_users      imagename       User Image      105     V~O     varchar(250)<br>
&gt; No<br>
&gt; Text box, mandatory entry<br>
&gt; user_name / vtiger_users      user_name       User Name       106     V~M     varchar(255)<br>
&gt; YES<br>
&gt; Non editable picklist<br>
&gt; status / vtiger_users         status  Status  115     V~O     varchar(25)     No<br>
&gt; Currency in user details<br>
&gt; currency_id / vtiger_users    currency_id     Currency        116     I~O     int(19)         No<br>
&gt; hour_format / vtiger_users    hour_format     Calendar Hour Format    116<br>
&gt; V~O   varchar(30)     No<br>
&gt; ??? - Currency in modules - missing entries at<br>
&gt; <a href="http://wiki.vtiger.com/index.php/Ui_types" target="_blank">http://wiki.vtiger.com/index.php/Ui_types</a><br>
&gt; currency_id / vtiger_pricebook        currency_id     Currency        117     I~M<br>
&gt; int(19)       YES<br>
&gt; currency_id / vtiger_invoice  currency_id     Currency        117     I~O     int(19)         No<br>
&gt; Admin toggle, checkbox<br>
&gt; is_admin / vtiger_users       is_admin        Admin   156     V~O     varchar(3)      No<br>
&gt; Email, Popup picklist<br>
&gt; idlistsi / vtiger_emaildetails        parent_id       Parent ID       357     V~O     text    No<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Join vtiger community at <a href="http://forums.vtiger.com" target="_blank">http://forums.vtiger.com</a><br>
&gt;<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
View this message in context: <a href="http://old.nabble.com/UITYPE---TYPEOFDATA-map-for-vtiger-5.x-tp29007047p33739514.html" target="_blank">http://old.nabble.com/UITYPE---TYPEOFDATA-map-for-vtiger-5.x-tp29007047p33739514.html</a><br>

Sent from the vtigercrm-developers mailing list archive at Nabble.com.<br>
<br>
<br>
_______________________________________________<br>
<a href="http://www.vtiger.com/" target="_blank">http://www.vtiger.com/</a></font></span></blockquote></div><br></div>