EAV code generation and field sorting API