How do I display the red box alert on a custom app's icon?

Hi,
How do I display the red box alert on a custom app’s icon? It is not displayed even when there are pending entries in my custom doctype under custom app.

TIA

You can hook a custom notification config:

thanks. Though I have included my custom doctypes in notifications.py, the consolidated count appears on the app only and not on individual doctypes inside the app! What am I missing?

Hi, @krithi_ramani!
You have to edit the “hooks.py” file in your module folder. Uncomment this:

notification_config = “rzds_projects.notifications.get_notification_config”

Here ‘rzds_projects’ is my module, where my doctypes are. “rzds_projects.notifications.get_notification_config” is a path to function. Create in the same folder a file named “notifications.py” (if it doesn’t exist). And add there a function:


from future import unicode_literals
import frappe

def get_notification_config():
return { “for_doctype”:
{
“Komus”: {“docstatus”: 0},
“MTS Mobiles”: {“docstatus”: 0},
“Visualizations”: {“signed”: 0},
}
}


Here “Komus”, “MTS Mobiles” and “Visualizations” are my doctypes for which I want the red label appear for all Drafts (where docstatus is 0).

And I found out that (in my case) the red label appears only if doctype has a description. Don’t know if it is a bug, but it works for me such way.

2 Likes

Thanks Oleg. you are right, adding a description displays the red box in the doctype.

Hi,

I got this to work on the list when I click on my module from the desktop, but there there anything special I need to do for the red box to display on my desktop module icon?

thanking you in advance

regards
Hemant

No it automatically shows up in the parent module icon.

1 Like