Not saving any retrieved field data through custom script

I have retrieve current user name and department in a custom field named request_by, request_by_ department in Material Request in on load trigger. when I am saving the form the request by field is not being saved but the department is saved. Any help ?
Below is my custom script:

//Retrive requested by and approved by on load
frappe.ui.form.on(“Material Request”, {
onload: (frm) => {
//onload_post_render: function(frm) {
var cur_user_name =frappe.user.full_name ;

  if (frm.doc.workflow_state === "Pending"){
    if (!cur_frm.doc. request_by){
            cur_frm.set_value("request_by", cur_user_name);

// Fetch request_by_department from current user: Request by
frappe.ui.form.on(“Material Request”, “request_by”, function(frm) {
if (!cur_frm. request_by){{
‘method’: ‘frappe.client.get_value’, async: false,
‘args’: {
‘doctype’: ‘Employee’,
‘fieldname’: ‘department’,
‘filters’: {‘employee_name’: frm.doc. request_by}
callback: function®{
cur_frm.set_value(“request_by_department”, r.message.department);
Thanks in advance!