Create DocType Programmatically

Hi,

I’m trying to create a Doctype programmatically, I’ve added a doctype folder into my custom app and add json file as well, This is successfully create a doctype which I want but, It’s not setting up autoname and naming rule accordingly. My Json file is below.

{
“actions”:[],
“autoname”: “prompt”,
“doctype”: “DocType”,
“engine”: “InnoDB”,
“fields”: [
{
“fieldname”: “value”,
“fieldtype”: “Int”,
“in_list_view”: 1,
“label”: “Value”,
“reqd”: 1
}
],
“index_web_pages_for_search”: 1,
“is_submittable”: 1,
“links”: [],
“modified”: “2023-11-29 13:14:36.361509”,
“modified_by”: “Administrator”,
“module”: “Test Module”,
“name”: “Test Dcotype”,
“naming_rule”: “Set by user”,
“owner”: “Administrator”,
“permissions”: [
{
“amend”: 0,
“cancel”: 0,
“create”: 1,
“delete”: 1,
“email”: 1,
“export”: 1,
“if_owner”: 0,
“import”: 0,
“permlevel”: 0,
“print”: 1,
“read”: 1,
“report”: 1,
“role”: “System Manager”,
“set_user_permissions”: 0,
“share”: 1,
“submit”: 0,
“write”: 1
}
],
“quick_entry”: 1,
“show_name_in_global_search”: 1,
“sort_field”: “value”,
“sort_order”: “DESC”,
“track_changes”: 1,
“track_seen”: 1,
“track_views”: 1
}

I wanted to set as bellow,

but my doctype values are not setting up. could you please help me with this?

Thank you.

This is a first Time Configuration you can set as doctype level. It will take automatically.

Sorry, could you please elaborate that? I couldn’t understand.

Please go through this
https://frappeframework.com/docs/user/en/basics/doctypes/naming

you mean priority of naming?

According to my understanding the values for naming rule and auto name are not setting up. could you please help me with that?

Thank you.