Hi all… I have added a server script where if my probabilty value is in between 0 to 30 the probabilty value will be low and like for medium(30 to 60)and high(60 to 90).
if doc.probability1 >= 0 and doc.probability1 <= 30:
doc.db_set(‘probability_value12’, ‘Low’)
if doc.probability1 > 30 and doc.probability1 <= 60:
doc.db_set(‘probability_value12’, ‘Medium’)
if doc.probability1 > 60 and doc.probability1 <= 100:
doc.db_set(‘probability_value12’, ‘High’)
the scenario set in the opportunity.
Please check it script.
frappe.ui.form.on('Opportunity', {
transaction_date: function(frm) {
//var curdate = your_date_field;
var curdate = frm.doc.transaction_date;
var dateObj = new Date(curdate);
var month = dateObj.getUTCMonth() + 1;
var day = dateObj.getUTCDate();
var year = dateObj.getUTCFullYear();
frm.set_value("your_field_name", month +"/"+ year);
// output : 11/2022
// field type must be data.
}
});