I’ve tried 189 fields as a submittable doctype. But it doesn’t work as submittable. If I change the fields to 90 it’s working. Is there any field limits for submittable doctype?
rahib
December 3, 2024, 11:31am
2
I don’t think so. Many of the transactional documents of ERPNext which are submittable has 200+ fields. Like Sales Invoice, Purchase Invoice etc
Thanks for the information
Related experiment that you can do.
opened 08:40AM - 12 Nov 17 UTC
closed 08:40AM - 12 Nov 17 UTC
discussion
Overload doctype with data fields or check fields
Related Information https://m… ariadb.com/kb/en/library/maximum-number-of-columns/
```
def overload_doctype():
field = {
"fieldtype":"Data" # "fieldtype": "Check"
}
try:
dt = frappe.get_doc("DocType", "Overload")
except Exception as e:
dt = frappe.new_doc("DocType")
dt.module = "Apitester" #custom app name
dt.name = "Overload"
dt.append("permissions", {
"role": "System Manager"
})
dt.append("fields", field)
dt.save()
frappe.db.commit()
while True:
dt.append("fields", field)
dt.save()
frappe.db.commit()
```
run the function from console
```
overload_doctype()
```
Error Encountered by overloading data fields
```
(1118, 'Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs')
---------------------------------------------------------------------------
OperationalError Traceback (most recent call last)
/home/revant/frappe-bench/apps/frappe/frappe/commands/utils.pyc in <module>()
----> 1 overload_doctype()
/home/revant/frappe-bench/apps/frappe/frappe/commands/utils.pyc in overload_doctype()
24 except Exception as e:
25 print(e)
---> 26 raise e
OperationalError: (1118, 'Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs')
```
- Shows 110 Fields added data_1 to data_110 in doctype
- There is also data_111 field under overload doctype in database but it is missing in overload.json
- running the overload_doctype() function again adds one field in database, throws error
- field missing in overload.json (no. of fields stuck at data_110 in json)
Error during check fields overload
```
(1005, 'Can\'t create table `d56f64d9177aef30`.`#sql-39b_43e` (errno: 185 "Too many columns")')
---------------------------------------------------------------------------
OperationalError Traceback (most recent call last)
/home/revant/frappe-bench/apps/frappe/frappe/commands/utils.pyc in <module>()
----> 1 overload_doctype()
/home/revant/frappe-bench/apps/frappe/frappe/commands/utils.pyc in overload_doctype()
25 except Exception as e:
26 print(e)
---> 27 raise e
OperationalError: (1005, 'Can\'t create table `d56f64d9177aef30`.`#sql-39b_43e` (errno: 185 "Too many columns")')
```
- Shows 1003 Fields added check_1 to check_1003 in doctype
- There is also check_1004 field under overload doctype in database but it is missing in overload.json
- running the overload_doctype() function again adds one field in database, throws error,
- field missing in overload.json (no. of fields stuck at check_1003 in json)
@achillesrasquinha @codingCoffee