I need to add a “Print pdf” in the list view of my custom module.
But before trying to use the function to print pdf, I can’t make the item appear in the menu (while I did this integration without problems in the detail view).
Hi, yes I realized the error and now everything works. Thanks was so obvious that I didn’t see it.
However, something strange happens in “Bulk Action”, I see “Email” when the user cannot access to the Email module but only accesses these custom modules (see screenshot).
How is it possible? Can I delete the entry?
This problem also occurs without the change to print pdf.
Basically this is a custom module, made with Builder from a basic module and it doesn’t even have the file view.list.php.
The user in question sees only this and another custom module, the others are all disabled and does not have the email configured in his profile. So, where can this menu item come from? What checks can I make?
Thanks so much.
Hi and sorry for the double post.
Only now, I am realizing that the export has 2 problems
if there are few records, pdf is exported correctly, while if there are many I receive a “Database Error”.
Is there any parameter I need to change in my php.ini?
If I select more rows to export, for example 3, it creates a three-page pdf instead of continuing to put the rows of the table one below the other as happens on lineitems in the offers.
Is there a solution for this?
About “Composi Email”
You made custom module based on “Person” object. This object have field “email” and when there is field “email” in vardefs.php the button “Composi Email” is automatic included. You can see file: include/ListView/ListViewDisplay.php if you find the call “buildComposeEmailLink”. You can make:
Switch off “Person” object from custom vardefs.php of your module. Include only needed fields to you custom vardefs.php fields from “Person” object.
You can unset field “email” from custom vardefs of your module.
I think that the first way is better.
Oh, thanks for your valuable suggestion.
Can you also suggest something about the two export pdf problems?
About a possible export size limit I don’t know where to intervene but on the second point, I saw that this is the standard behavior even if you export from listview of the lead module, for example. Can this be changed in some way and get an export formatted on several consecutive lines?
I didn’t see this poroblem ever. I tested some decison which I have now. Export from different modules work with out problem. May be you can give some more information from your log files (SuiteCRM and web-server).
I don’t understend. You did write about standart export of module records to csv file or about somethink export to pdf format?
Hi and thanks for reply.
For database, I try to get out of logs and let you know.
As for pdf: the export from listview generates a record per sheet. So pdf will have as many pages as there are lines exported (and even on standard modules, like leads, it works like this).
I, however, I would like all the lines below each other (as happens to the items in quote module).
Keep in mind that the code follows this guide: https://harveyit.co.uk/projects-and-guides/suitecrm-a-pdf-guide
I know I should use reports to get this but, in this specific case, I can’t.
I hope there is a way to get what I need.
So, in the meantime I saw that the new page is created with
$ Pdf-> AddPage ();
in formLetterPdf.php > AOS_PDF_Templates
So, theoretically if I exclude this variable, records are written one under the other and not in a new page (maybe there is also the way to put an if and make sure that the modification is performed only for a specific module) . Perhaps this can also be used by others for a workaround.
However, both in the standard version and in the modified version, I continue to receive an error if I export more than 20 records (in practice if I export more pages).
The error on the screen is a “database error” and I have difficulty understanding logs: is this, by chance, a known bug?
Tue Dec 17 15:01:47 2019 [DEBUG] Hook called: ::server_round_trip
Tue Dec 17 15:01:47 2019 [DEBUG] Calling MySQLi::disconnect()
Tue Dec 17 15:01:47 2019 [FATAL] Exception handling in /var/www/html/suitecrm/include/MVC/Controller/SugarController.php:400
Tue Dec 17 15:01:47 2019 [FATAL] Exception in Controller: Database fallito. Si prega di fare riferimento a suitecrm.log per i dettagli.
Tue Dec 17 15:01:47 2019 [FATAL] backtrace:
#0 /var/www/html/suitecrm/include/database/DBManager.php(353): sugar_die('Database fallit...')
#1 /var/www/html/suitecrm/include/database/DBManager.php(328): DBManager->registerError(' Query Failed: ...', ' Query Failed: ...', true)
#2 /var/www/html/suitecrm/include/database/MysqliManager.php(179): DBManager->checkError(' Query Failed: ...', true)
#3 /var/www/html/suitecrm/modules/AOS_PDF_Templates/formLetterPdf.php(62): MysqliManager->query(' SELECT clob_c...', true)
#4 /var/www/html/suitecrm/include/MVC/Controller/SugarController.php(1020): require_once('/var/www/html/s...')
#5 /var/www/html/suitecrm/include/MVC/Controller/SugarController.php(468): SugarController->handleEntryPoint()
#6 /var/www/html/suitecrm/include/MVC/Controller/SugarController.php(373): SugarController->process()
#7 /var/www/html/suitecrm/include/MVC/SugarApplication.php(113): SugarController->execute()
#8 /var/www/html/suitecrm/index.php(52): SugarApplication->execute()
Tue Dec 17 15:01:47 2019 [FATAL] Query Failed: SELECT clob_clob_condizioni.* ,clob_clob_condizioni_cstm.validaa_dal_c,clob_clob_condizioni_cstm.valida_al_c,clob_clob_condizioni_cstm.fatturato_ap_c,clob_clob_condizioni_cstm.potenziale_c,clob_clob_condizioni_cstm.aos_product_categories_id_c,clob_clob_condizioni_cstm.aos_product_categories_id1_c,clob_clob_condizioni_cstm.prezzo_netto_c,clob_clob_condizioni_cstm.famiglia_c,clob_clob_condizioni_cstm.linea_c,clob_clob_condizioni_cstm.descrizione_c,clob_clob_condizioni_cstm.prezzo_c,clob_clob_condizioni_cstm.prezzo_scontato_c,clob_clob_condizioni_cstm.ricarica_grossista_c,clob_clob_condizioni_cstm.margine_grossista_c,clob_clob_condizioni_cstm.currency_id,clob_clob_condizioni_cstm.grossista_per_scheda_c , jt0.user_name modified_by_name , jt0.created_by modified_by_name_owner , 'Users' modified_by_name_mod , jt1.user_name created_by_name , jt1.created_by created_by_name_owner , 'Users' created_by_name_mod , jt2.user_name assigned_user_name , jt2.created_by assigned_user_name_owner , 'Users' assigned_user_name_mod, jt3.name grossista , jt4.name codice_prodotto , jt5.name clob_clob_anagrafica_clob_clob_condizioni_2_name, jtl5.clob_clob_f71dgrafica_ida clob_clob_f71dgrafica_ida, jt6.name linea_prodotto_c , jt7.name famiglia_prodotto_c FROM clob_clob_condizioni LEFT JOIN clob_clob_condizioni_cstm ON clob_clob_condizioni.id = clob_clob_condizioni_cstm.id_c LEFT JOIN users jt0 ON clob_clob_condizioni.modified_user_id=jt0.id AND jt0.deleted=0
AND jt0.deleted=0 LEFT JOIN users jt1 ON clob_clob_condizioni.created_by=jt1.id AND jt1.deleted=0
AND jt1.deleted=0 LEFT JOIN users jt2 ON clob_clob_condizioni.assigned_user_id=jt2.id AND jt2.deleted=0
AND jt2.deleted=0 LEFT JOIN accounts jt3 ON clob_clob_condizioni.account_id_c = jt3.id AND jt3.deleted=0 LEFT JOIN aos_products jt4 ON clob_clob_condizioni.aos_products_id_c = jt4.id AND jt4.deleted=0 LEFT JOIN clob_clob_anagrafica_clob_clob_condizioni_2_c jtl5 ON clob_clob_condizioni.id=jtl5.clob_clob_988fdizioni_idb AND jtl5.deleted=0
LEFT JOIN clob_clob_anagrafica jt5 ON jt5.id=jtl5.clob_clob_f71dgrafica_ida AND jt5.deleted=0
AND jt5.deleted=0 LEFT JOIN aos_product_categories jt6 ON clob_clob_condizioni_cstm.aos_product_categories_id_c = jt6.id AND jt6.deleted=0 LEFT JOIN aos_product_categories jt7 ON clob_clob_condizioni_cstm.aos_product_categories_id1_c = jt7.id AND jt7.deleted=0 where ((join_clob_clob_anagrafica_clob_clob_condizioni_2_name.name like 'B-TECH SRL%')) AND clob_clob_condizioni.deleted=0: MySQL error 1054: Unknown column 'join_clob_clob_anagrafica_clob_clob_condizioni_2_name.name' in 'where clause'
Hi, There ins’t.
There is instead clob_clob_anagrafica_clob_clob_condizioni_2_c which is where the data were saved…
join_clob_clob_anagrafica_clob_clob_condizioni_2_name doesn’t make sense … where does it get this name from? And what worries me most, is how I can solve the issue…
Unfortunately until I tried this export on liview, the problem could not be seen.
Now looking at the query, I begin to understand.
The error is created on a selection of records to which SuiteCRM for some reason gives the name join_clob_clob_anagrafica_clob_clob_condizioni_2_name
That join_clob_clob_anagrafica_clob_clob_condizioni_2_name.name like ‘B-TECH SRL%’ is a selection (a filter) on a related type field (related to clob_clob_anagrafica which is a accounts type module).
The problem is then created if you filter records and export.
In any case, I don’t know how to intervene to solve it
I try to open a bug.
By the way, I confirm that the same behavior also occurs on standard modules (for example, accounts) if you apply a filter related to another accounts type module, select all filtered records and print pdf.
For completeness I add that “Select only the page” or “Select all” makes a difference.
If my filter has 35 results and I set the number of records per page out of 50, if I use the “Select page” option> print pdf IT WORKS, if I use “Select all” (despite having only one page)> print pdf IT DOESN’T WORK