Default value issues caused by "onchange" method

A default value for a field may not be set on the creation of a new record, even provided in the field definition

In many cases, the reason for that is an onchange​ method that is resetting the value for the field. Steps that can help in resolving the issue:

  • Identify the method that is causing the issue by searching by the field’s name, and seeing where the field’s value is reset.
  • Try to understand the current logic and how your change will affect it.
  • Override the method using super​ and apply your custom logic