How to get the amount of Contacts assigned to an Account
Summary:
How can I get the amount (count) of Contacts listed for an Account using Groovy?
Content (required):
The current groovy returns the incorrect number of contacts. Expected number is over 30, but only 2 is returned.
Version (include the version you are using, if applicable):
Code Snippet (add any code snippets that support your topic, if applicable):
def voPersonProfile = newView('PersonProfile');
def convc = newViewCriteria(voPersonProfile);
def convcr = convc.createRow();
def convci = convcr.ensureCriteriaItem('PrimaryCustomerId');
convci.setOperator('=');
convci.setValue(PartyId);
convc.insertRow(convcr);
voPersonProfile.appendViewCriteria(convc);
voPersonProfile.executeQuery();
long count = 0;
count = (voPersonProfile.getEstimatedRowCount()+1)
//println('Contacts found: ' + count)
return count;
Tagged:
0