You need to sign in to do that
Don't have an account?
Royal
how separate the id's based on recordsType ?
Hi All,
List<Account> ids=[select id from Account];
Set<ID> setids= Set<ID>();
Set<ID> SetAAA= Set<ID>();
Set<ID> SetBBB= Set<ID>();
for(Account acc: ids){
setids.add(acc.id);
I have all account id's in set object, so now i hvae to filter those id's based on recordtype.
like records type AAA then add to setAAA or Recordtype BBB then Add to SetBBB.
how to do code ?.
List<Account> ids=[select id from Account];
Set<ID> setids= Set<ID>();
Set<ID> SetAAA= Set<ID>();
Set<ID> SetBBB= Set<ID>();
for(Account acc: ids){
setids.add(acc.id);
I have all account id's in set object, so now i hvae to filter those id's based on recordtype.
like records type AAA then add to setAAA or Recordtype BBB then Add to SetBBB.
how to do code ?.
Please find below code snippet using which you can separate the Record Ids based on record types.
Here, lets suppose 'AAA' and 'BBB' are names of two record types in Account. When we excute this code, SetAAA contains all record Ids of record type 'AAA' and SetBBB contains all record Ids of record type 'BBB'.
Let us know if that helps you.
Best Regards,
BALAJI