Groovy to query only Contacts but not user records
Hi All,
I have actually written a code to query the Contact object based on email. But the query is also searching for user records with that email and returning the result as record found with that email address . How to restrict the query to only search for records in Contact Object. It shouldn't query in user records.
def email = nvl(Sender,'noreply@****.com');
def pProfileVO = newView('PersonProfile')
pProfileVO.appendViewCriteria("PrimaryEmailAddress = '${email}' AND PartyStatus = 'A' AND InternalFlag = 'N' AND PartyType = 'PERSON' AND SalesProfileType = 'ZCA_PROSPECT'")
pProfileVO.executeQuery()
Regards,
Kalyan
Tagged:
0