Try ERPNext Buy Support Partners Foundation

Get Dashboard Link Count


Is there any function or custom script I could use to get this count value? Like Sales Order = 1 and also the open count?

Hey @Shah1, I think you can use this url
Request URL:
[url]/api/method/frappe.desk.notifications.get_open_count
With params

  1. doctype: Sales Invoice
  2. name: ACC-SINV-2020-00257
  3. items: [“Payment Entry”,“Payment Request”,“Journal Entry”,“Invoice Discounting”,“Timesheet”,“Delivery Note”,“Sales Order”,“Sales Invoice”,“Auto Repeat”]

You can find this information when you save the document. Just change the doctype, docname, etc. to your content.
Later you can call it with frappe.call

Could you help me out on how to write a piece of custom script to get a single count value?

Yeah, sure.

frappe.ui.form.on('Customer', {
    refresh: function (frm) {
        frappe.call({
            method: "frappe.desk.notifications.get_open_count",
            args: {
                "doctype": "Customer",
                "name": cur_frm.doc.name,
                "items": ["Opportunity", "Quotation", "Sales Order", "Delivery Note", "Sales Invoice", "Payment Entry", "Issue", "Project", "Pricing Rule", "Subscription"]
            },
            callback: function (data) {
                console.log(data)
            }
        });
    },
})

In that data, you must sort what you need. Or just change the item in args.
I think it will works.
Cheers :wine_glass:

Yup . Thanks a lot! :slight_smile: