Change Default Value

Hi,

I want to use in the expense claim & Salary slip ONLY a different currency than the default currency.
I think that I can do it from “customize form” by making the default currency for those 2 forms different than the default company currency.

But I don’t know how can i do it.

Thanks

@hhashiesh1 if the currency is static do you can put the name of the Currency in the “Default” options, if not, do you will need a custom script.

@max_morais_dmm Thanks, i already tried the default value but it didn’t work,
Can you help me in the custom script?

@hhashiesh1,

frappe.ui.form.on("DocType", "refresh", function(frm,cdt, cdn){
    frm.set_df_property("fieldname", "default", "currency");
    frm.refresh_field("fieldname");
});

this is the basic concept, do you need replace DocType, fieldname and currency for the values that do you want!

@max_morais_dmm Thanks for your support, would you please let me know if this is right or not as it didn’t work

frappe.ui.form.on(“Expense Claim”, “refresh”, function(frm,cdt, cdn){
frm.set_df_property(“total_claimed_amount”, “default”, “EGP”);
frm.refresh_field(“total_amount_reimbursed”);
});

@hhashiesh1, the field should be the same in set_df_property and refresh_field

@max_morais_dmm I modified it, but it didn’t work also…
Should I modify any other thing after making the script ??

frappe.ui.form.on(“Expense Claim”, “refresh”, function(frm,cdt, cdn){
frm.set_df_property(“total_claimed_amount”, “default”, “EGP”);
frm.refresh_field(“total_claimed_amount”);
});

Have you found solution?

It worked in v8

now It doesn’t work in v9
Can you help to check ?

Not yet

We appreciate your continuing business, looking forward to hearing from you shortly

Best Regards,