mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-13 09:43:49 +00:00
[docs] custom script examples, [build] move CMS make to app via event_handlers.on_build
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
---
|
||||
{
|
||||
"_label": "Custom Script: Fetch Values from Master"
|
||||
}
|
||||
---
|
||||
To pull a value of a link on selection, use the `add_fetch` method.
|
||||
|
||||
add_fetch(link_fieldname, source_fieldname, target_fieldname)
|
||||
|
||||
### Example
|
||||
|
||||
You create Custom Field **VAT ID** (`vat_id`) in **Customer** and **Sales Invoice** and want to make sure this value gets updated every time you select a Customer in a Sales Invoice.
|
||||
|
||||
Then in the Sales Invoice Custom Script, add this line:
|
||||
|
||||
cur_frm.add_fetch('customer','vat_id','vat_id')
|
||||
|
||||
|
||||
---
|
||||
See: [How to create a custom script](!docs.dev.custom_script.html)
|
||||
Reference in New Issue
Block a user