I am looking for a way to create a table entry form for an entity type. We are trying to create an invoice form. I am currently using a field collection for each invoice line.
Order (node) Invoice (node) Invoice line (field collection)
I am currently using the field_collection module along with field_collection_table. I am using entity reference to connect the invoice to the order and invoice line This works great except when we have more than roughly 75 rows. At that point we are unable to add new rows to the table. Users are getting a 500 AJAX error.
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /system/ajax StatusText: Internal Server Error ResponseText:
Originally I received an error about max_imput_vars limit of 1000 when we got to about 50 lines. I have since changed the limit to 100000. Now nothing shows up in the server error log or the Drupal recent log messages. My PHP settings are:
memory_limit = 256M max_execution_time = 120 max_imput_time = 120 post_max_size = 160M upload_max_filesize = 128M max_input_vars = 100000
My thought now is to create a custom entity for invoice line. The trouble is how to display this entity as a table and allow users to edit multiple items at once. Some invoices could have 500 rows and I need a way for users to be able to quickly move from line to line. For non-Drupal forms I have used jQuery to dynamically add new rows to a table. Not sure how this would work for Drupal since each field in the table has an id that is specific to each row (e.g. edit-field-desc-und-31-value).
Any suggestions? A separate but important issue is a need to regularly autosave. Users would not be happy if they added 300 rows and lost power, computer froze, or something else happened.