Update Dtetime filed up on workflow action

i have workflow action ( received to agency )

i have doctype field ( datetime_received )

how i can updated datetime_received field and put current date time when i choosing received by agency action. by using client script .

thanks

I tried this script but it doesn’t work


frappe.ui.form.on('dmc', {
    before_workflow_action: (frm) => {
        if ((frm.selected_workflow_action === 'Send to agency'))
        {
          frm.set_value("date_of_receipt_from_agency", frappe.datetime.nowdate());
            
        }
        
    },
});

Hi @Osk,

Perhaps it didn’t work.

Please attempt it in a different manner.
Please refer to the provided reference.

Thank You!