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