You need to sign in to do that
Don't have an account?
Laxmaya Chn
How to crosscheck AccountIDs(Salesforce)
In my project as the data is coming from third party where they are sending data from their end with Salesforce ID(Account). Sometimes they are sending invalid id's(which are not existed in our database for Accounts), hence I need to cross check new incoming ID with existing ID and want to through an error if the ID doesn't exist.
You can write down the apex logic for like below:
1. Create a set 'accountIdSET' for third party Account Ids
2. Query in your current org like 'SELECT ID FROM ACCOUNT WHERE ID IN: accountIdSET
3. Now you can itertae over the list and create a map for map<Id, Account>
4. Now again iterate over the accountIdSET and then check with the recently created map if you will find any account then it's sexisting otherwise not.
Thanks,
Arun