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

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!


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

1 Like

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:

@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.

1 Like

It was our cloud instance (version 11).

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