How to Count total number of links

Hi Guys,

i have created two doctypes, which are “leads” and “callcamp”. I have created a field named “campname” in “leads” doctype and linked “callcamp” doctype.

so “campname” field will display a dropdown menu showing all the records of “callcamp” doctype.

i have created 2 records in “callcamp” which are “anu” and “raji”.

by clicking on a record named “anu” from “callcamp” doctype and navigate to links option as shown below, i will be able to see all the leads which are linked to this record (anu).

i would like to create a field in “callcamp” doctype to display the total number of links which has the same value as the record name.

For an example -

i would like to see how many records in “leads” doctype have linked to “anu” from “callcamp”.


Would be grateful if you guys could help me on this.

@crazy_explorer You can do that using a Client Script. Customize the Call Campaign doctype, scroll to fields and post a screenshot of the fields.

Hi @crazy_explorer,

You can set without custom script.

Please step by step apply it.

  1. Go to the Lead Source customize form.

  1. Then down the page and go to the Document Links section, add the Link DocType and Link fieldname. Update the form and reload the system.

  1. Go to the Lead Source doctype and check it dashboard. connected lead and opportunity show with total count number.

Hope you will understand the all step.

Thank You!