How to make the status is display on the top with name?

How to make the status is display in green box at top with name.

Early I worked with workflow state and action. While changing the action. Status will show.

But now I don’t have action. Status is only one I have. I want to show the status at top and the list view.

Is it possible?

Version:

Erpnext - 14
frappe - 14

Hi,

Please try following Client Script:

frappe.ui.form.on('Prospect', {
    refresh: function(frm) {
        // Move status field near the title
        let title_field = frm.fields_dict['title'];
        let status_field = frm.fields_dict['status'];
        
        // Ensure both fields exist
        if(title_field && status_field) {
            // Create a custom HTML field near the title to display the status
            let status_html = `
                <div style="display: flex; align-items: center;">
                    <div style="margin-right: 10px;">
                        ${title_field.$wrapper.html()}
                    </div>
                    <div>
                        <label>Status:</label>
                        <span class="status-indicator">${frm.doc.status}</span>
                    </div>
                </div>
            `;
            
            // Replace the title field with the custom HTML
            title_field.$wrapper.html(status_html);
        }
    }
});

Thanks,

Divyesh Mangroliya

If field name is status then you can set it without the client script.

Please check it.

Output:

Thankyou for your response, @mangroliya ,

It’s changing the value on the field that is created,
I want to add the HTML near the title.

frm.fielddicts 

represent the fields HTML in from.

Thankyou for your response @NCP,

I tried the document state where you mentioned. And,

It’s custom field, In 14 latest version, when we create a field it add custom infront of it.

I think so why it is not worked.

The field name should be status instead of the custom_status.

So go to the custom field doctype and rename it.

rename field reference (It’s also worked in v14):

1 Like

HI @NCP
Thank you for your reply,

I tried to change the name, the status on above is showing. But After I got error on control js, So, the form is unable to render

Tested in lasted v14, worked properly. please check it.

Thank you @NCP
I will update to the Latest version.

I updated the version. Still i am facing the same issue on control.js from is not rendering

please check, if any client script is applied or not. if applied then remove/comment on it.

No client script was added, Just now I did a bench update, so I stashed all the changes on apps.