Hi, can you explain to me how does autocomplete works, like when i choose a customer when doing a quotation, the labels as price list, currency are autocompletion them selves, i wanted to make another label thats do autocomplete by choose the customer, but i dont know how does it work
@Dany_Carvalheiro, this are based in 2 features
add_fetch
and set_df_property
- add_fetch, works like the VLOOKUP of excel, to fetch a value from a referenced record
- set_df_property change certain properties of a field, in this case (label)
These actions are made in JavaScript
1 Like
Steps:-
1.For that Go to āCustomize Formā
Enter Form Type=Item Price
Add new Row-
Label= Item Group
Type=Data
check option āRead Onlyā->Done
Drag that Row under āItem Nameā row ,if you wantā¦
click on āUpdateā button
2.After that Go to āCustom Scriptā form (search for "Custom Script)
Create āNewā
select Doc Type=Item Price
Write Script:-
frappe.ui.form.on(āItem Priceā, āonloadā, function(frm) {
cur_frm.add_fetch(āitem_codeā, āitem_groupā, āitem_groupā);
})
Save Form.
You can refer following link also to read more things about custom script
thank you