Row Size Too Large: MySQL Error 1118

I am trying to create a custom field in sales invoice but showing the error .

There is a physical limit set. I’m not sure how you determine that, but you should see a visual indicator when you choose to customize the doctype. I have added only a few fields to sales invoice and it shows over 50% used capacity.

1 Like

This is a MariaDB/MySQL limitation. Not a Frappe Framework limitation.

SQL rows have a maximum size. The limit depends on the quantity of Columns, and the datatype of those Columns.

As the error states, the limit is 64kb maximum. But you can bypass by switching certain columns to TEXT/BLOB (basically turns them into “pointers”)

You could also create a 2nd DocType. Put your custom columns in there. And then JOIN to Sales Invoice as needed. This isn’t always great from a UI perspective (because of Framework limitations). But it’s a good SQL design behavior.

2 Likes