How to get related list records count using on click javascript?
For example contact is a related list in account detail page.A custom button is there in account detail page.If I click it,I want to know how many contacts are associated with that account.
The sample code is given below.
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
var num=
sforce.connection.query('SELECT Id,name FROM contact WHERE accountid = \'{!Account.Id}\'');
var d=num.getInt('size');
alert(d);
window.location.reload();
For example contact is a related list in account detail page.A custom button is there in account detail page.If I click it,I want to know how many contacts are associated with that account.
The sample code is given below.
{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
var num=
sforce.connection.query('SELECT Id,name FROM contact WHERE accountid = \'{!Account.Id}\'');
var d=num.getInt('size');
alert(d);
window.location.reload();
Thank you for This Post, It is used for me...
ReplyDelete