Workflow State = Approved Filter of Project in the Saes Order Doc Type

Team,

Can anyone assist me with a client Script where in the Sales Order Doc Type under the Accounting Dimensions, it should filter the Project with the Workflow state = Approved only, and now it is showing all the status. I have implemented the Workflow in the Project Module

Hi @jitendra,

Please apply the client script for Sales Order.

frappe.ui.form.on('Sales Order',  {
    refresh: function(frm) {
        frm.set_query("project", () => {
          return {
            "filters": {
              "workflow_state": "Approved"
            },
          };
        });
    }
});

Then reload and check it.

Reference: Overriding Link Query By Custom Script

Thank You!

1 Like

Appreciate for your Reply and immediate help @NCP,

But I have tried the same Client Script

But still, it shows All the Workflow State

Hi @jitendra,

Please check it.

Project:

Sales Order:

Thank You!

OK @NCP, Thanks again for your kind and immediate attention for my queries

@NCP, I have checked it is happening for 1 Trigger but again it shows all the Workflow States.

Please check it @jitendra,

Thank You!

1 Like

Thanks again for your sincere efforts. I will check again and will get back to you.

@NCP, Thanks a TrillionTons. It is working now.

@NCP, Yes you are an amazing one! In this era, no one works without any bounty of fees, but you always help with selfless and I am proud of you for being a great contributor.

1 Like