[Vtigercrm-developers] Thunderbird 3 Extension Nearly working!

Alan Lord (News) alanslists at gmail.com
Thu Nov 19 00:44:25 PST 2009


Hi all,

I've been hacking away at the vtiger extension and I have had had some 
success.

Using my modified extension running in the pre-release of TB 3, I can 
now add emails to vtiger and import Contacts into an existing address book.

Whilst I am at this stage though, I want to try and fix a bug that is 
causing one of customers a problem.

This line of code in the extension:

client.query("select * from Contacts;",

gets all contacts for a user.

At the vtiger end of this connection there is a LIMIT clause which just 
stops returning records at 100. (See this forum thread for details 
http://forums.vtiger.com/viewtopic.php?t=28076&highlight=limit+100).

Increasing this value works until you hit the limit of the webserver for 
the length of the URL, it seems that around 500 records and you will get 
a 414 Error. My customer has nearly 1000 records.

What I would like to do is to use something like this:

http://dev.mysql.com/doc/refman/5.0/en/information-functions.html#function_found-rows

to get the number of rows that *would* be returned and then be able to 
iterate through manageable chunks of returned data.

"SQL_CALC_FOUND_ROWS and FOUND_ROWS() can be useful in situations when 
you want to restrict the number of rows that a query returns, but also 
determine the number of rows in the full result set without running the 
query again. An example is a Web script that presents a paged display 
containing links to the pages that show other sections of a search 
result. Using FOUND_ROWS() allows you to determine how many other pages 
are needed for the rest of the result. "

I guess my question is can I just pass this request straight through to 
the DB or does there need to be any wrapping done in vtiger.

Secondly, I think this is a feature of MySQL 5.0 and onwards. Is this 
going to be a problem?

TIA

Alan




More information about the vtigercrm-developers mailing list