There are properties like read_only, reqd. Likewise I need to create new property called variant. How to do so?
can you please share your use case?
Also, properties and doctypes are part of the Frappe Framework. You must get to the core of it.
allow_bulk_edit: 0
β
allow_in_quick_entry: 0
β
allow_on_submit: 0
β
bold: 0
β
collapsible: 0
β
colsize: 1
β
columns: 1
β
creation: "2023-11-16 17:06:05.067305"
β
docstatus: 0
β
doctype: "DocField"
β
fetch_if_empty: 0
β
fieldname: "variant_1"
β
fieldtype: "Select"
β
hidden: 0
β
hide_border: 0
β
hide_days: 0
β
hide_seconds: 0
β
idx: 2
β
ignore_user_permissions: 0
β
ignore_xss_filter: 0
β
in_filter: 0
β
in_global_search: 0
β
in_list_view: 1
β
in_preview: 0
β
in_standard_filter: 0
β
is_custom_field: null
β
label: "Variant 1"
β
length: 0
β
linked_document_type: null
β
modified: "2023-11-16 19:13:00.779131"
β
modified_by: "Administrator"
β
name: "1ae08facdf"
β
no_copy: 0
β
non_negative: 0
β
owner: "Administrator"
β
parent: "Demo Stock"
β
parentfield: "fields"
β
parenttype: "DocType"
β
permlevel: 0
β
precision: ""
β
print_hide: 0
β
print_hide_if_no_value: 0
β
read_only: 0
β
remember_last_selected_value: 0
β
report_hide: 0
β
reqd: 0
β
search_fields: null
β
search_index: 0
β
set_only_once: 0
β
show_preview_popup: 0
β
translatable: 0
β
unique: 0
β
variant: "Processor Type"
Something like variant: βProcessor Typeβ, also how to change fieldname as name of variant and update the fields. I am getting some errors like TypeError: df is undefined
var docfield = frm.fields_dict['item_component'].grid.docfields[i];
if (i = 0 && i <= variants.length) {
var variant = variants[i].variant;
docfield.fieldname = variant;
}
1 Like