Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. public class SetIndustryChemical {
  2.  
  3. public Mylist(String list, Integer Id)
  4. {
  5. List<Account> Acclist = New list<Account>();
  6. AccList.add(Name = 'Rumi Bajaj', Industry = 'Chemical');
  7. AccList.add(Name = 'Gautam Bajaj', Industry = 'Chemical');
  8. AccList.add(Name = 'Parth', Industry = 'Chemical');
  9. system.debug('Current List='+AccList);
  10. Acclist=[SELECT id FROM Account WHERE Industry='Chemical'];
  11. Set<id> AccSet = New Set<id>();
  12. for (Account a:Acclist){
  13. AccSet.add(a.id);
  14. }
  15.  
  16. }
  17. }
  18. }
  19.  
  20. public class SetIndustryChemical {
  21.  
  22. public void Mylist() {
  23. Set<id> AccSet = New Set<id>();
  24. for (Account a:[SELECT id FROM Account WHERE Industry='Chemical']){
  25. AccSet.add(a.id);
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement