You need to sign in to do that
Don't have an account?
Dave The Rave
compare 2 the value of standard fields and count records
As a an admin, I am using the Developer Console to execute an SOQL query. The aim is to count the number of records on the lead object where the text fields "Name = firstname and lastname" and "Company" have the same values.
I wrote this query, but got an error
SELECT Id, firstname, lastname FROM lead WHERE [lastname + firstname = Company]
After searching Google, it seems that the goal is not achievable using SOQL, can anyone confirm this? is there another simple solution using Apex run from the developer console?
For example firstname & lastname = "Peter Smith" AND Company = "Peter Smith", so this is one record where the name and company are the same.
Thanks,
Dave
I wrote this query, but got an error
SELECT Id, firstname, lastname FROM lead WHERE [lastname + firstname = Company]
After searching Google, it seems that the goal is not achievable using SOQL, can anyone confirm this? is there another simple solution using Apex run from the developer console?
For example firstname & lastname = "Peter Smith" AND Company = "Peter Smith", so this is one record where the name and company are the same.
Thanks,
Dave
You can run the below script in Execute Anonymous window and than check the debug logs to get the count:
Let me know if you need any other help on this.
Thanks,
Abhishek Bansal.
All Answers
You can run the below script in Execute Anonymous window and than check the debug logs to get the count:
Let me know if you need any other help on this.
Thanks,
Abhishek Bansal.
There can be many options to get the list in excel:
- You can send an email from console by adding all the records in a file and than adding this file in email.
- You can get the ids of the records that meets the criteria and after that you can generate a report on those ids.
If you got the solution than please close this question by choosing a best answer. Let me know if you need any other help on this.Thanks,
Abhishek Bansal.
Gmail: abhibansal2790@gmail.com
Skype: abhishek.bansal2790
Phone: +917357512102