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);
}
}
});