cupuno
March 1, 2018, 2:30am
1
hello,
i am using “cur_frm” in most of my custom scripts. For example, i am using this code to fetch in “Sales Order”, i place the code at the top and outside any event:
cur_frm.add_fetch(‘item_code’,‘customs_tariff_number’,‘customs_tariff_number’);
when i add an item in sales order, “customs_tariff_number” will be load automatically. it does work very good.
but i have read those discuss:
Hi guys,
It is mostly question to frappe developers:
What are advantages of using cur_frm over frm or vice versa?
Maybe in some cases global var is not updated (by events) aspecially when you have calls on global scope?
I think one should avoid using global variables as much as possible. What do you think?
Hello;
What is the difference between using cur_frm and this.frm?
And when we do scripting in js file, what is this._super() is doing?
In other words: Why we use this? It indicates for what exactly?
Regards
Bilal
and i know that cur_frm will be dropped in new api.
is there any alternative to cur_frm object? i have to modify my code for future update.
please advise. thank you.
Hey @cupuno , this is an interesting discussion point but I think maybe your post was cut off. Can you finish your thought about your use case regarding cur_frm
.
cupuno
March 1, 2018, 5:31am
3
i am sorry my post cut-off, i have re-edit my previous post.
1 Like