ERPNext Conference 2019* ERPNext.com Blog

System does not change Data to Int in the database, only front end

error

#1

I have spent the last 90 minutes fixing a problem, that I hope you all will prevent yourself from experiencing by reading this:

  1. I created a new field in a DocType. I chose data as field type. But I actually needed numbers.
  2. I repeated this with 5 more fields.
  3. I realized that I had to use the field type “Int” (for Integer / numbers) later when I created a custom script for a calculation.
  4. I tried to change the field type. Do not do this! All trouble started here. Error messages. Wrong calculations. Silly displayed numbers in reports.
  5. The only fix that I found was to erase all fields and recreate them with the right field type (Int). It all now works like a charm.

Learning: Know your field type from the start. Do not change it, stupid!


#2

Weeks ago I have something similar, hehehe, he has to do it from drawing and when the idea is clear, the configuration is done in the DOCtype, Greetings from Colombia


#3

I don’t blame ERPNext for this. It’s incredibly difficult to convert a string into an integer or float or vice versa. Maybe there could be ways to prevent users from doing such bullshit … :blush:


#4

@Martin_Seibert I agree, if the system does not really change it in the database, it should throw an exception. Also best to share the version of your test instance for the record.


#5

It was our cloud instance (version 11).


#6

Just ran into the same issue… wish I had read this earlier :expressionless:

Cheers!