How do I prevent focus on first input?

I am using frappe.set_route to populate several fields with a custom script and one of the fields I am setting is defeated by a focus function I want to block or skip because it will ditch whatever value I just populated in that field.

I’ve tried several variations of blur() with no success. Suggestions welcome.

Can you share the code you are using to populate those field ?

You can take a look at the Routing section here -

route_options can be used to set fields when using set_route.

Here’s a snippet:

onload_post_render: function(frm) {
    if(frappe.route_options != undefined){
       frm.set_value("naming_series", "PINV-")
       frm.set_value("company", frappe.route_options.company);
       frm.set_value("supplier", frappe.route_options.party);

The fields are setting correctly, but after a specific timeout after onload_post_render, it focuses on the first input (a link field, supplier) and destroys the data I just set. I don’t know how to block it.

found any solution to it?