Automatic Delivery Date

Hi Everyone,

I had a client who needs to put the delivery date after 5 days of the sales order date, how to do that?

Thank you

Use Below Custom Script

cur_frm.cscript.transaction_date = function(doc, cdt, cd){
cur_frm.set_value(“delivery_date”, frappe.datetime.add_days(doc.transaction_date, 5));
}

Hi Mohitchechani,

this error raised to me

the custom script:

Thank you

Please edit inverted commas before delivery date from “ to " .

After changing color for delivery_date should change to green

Hi Mohit,

nothing happened, without Error

Script:

Sales order Screen:
2022-03-10_13-47-16

Just use this code

cur_frm.cscript.transaction_date = function(doc, cdt, cd){
cur_frm.set_value(“delivery_date”, frappe.datetime.add_days(doc.transaction_date, 5));
}

Also you have entered single inverted commas instead of double.

Do not enter anything. Its working, I have tested on my side

https://docs.erpnext.com/docs/v13/user/manual/en/customize-erpnext/client-scripts/update-date-field-based-on-value-in-other-date-field

Hii @fsorur and @mohitchechani,

Please check:

Code is here:

cur_frm.cscript.transaction_date = function(doc, cdt, cd)
{
    cur_frm.set_value("delivery_date", frappe.datetime.add_days(doc.transaction_date, 5));
};

Thank You!