function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
nagarjuna gurajanagarjuna guraja 

Need Answer

1.How to create empty string of sets in apex?
2.How to create list of typeid in Apex?

Awaiting for Answer!
Thanks in Advance
Sai PraveenSai Praveen (Salesforce Developers) 

Hi Narajuna,

Please find the answer below
 

Set<String> stringset = new set<String>();
 


The above will create a set of string which is empty.
 

List<id> idlist= new List<id>();
idlist.add('0015j00000AAQVWAA5');
 



The above will create a list of ids and I added some sample Account id to the list. You can add based on your requiurement.

Let me know if you need any help on it.

If this solution helps, Please mark it as best answer.

Thanks,
 

 

mukesh guptamukesh gupta
Hi Ngarguna,

1.How to create empty string of sets in apex?
 
Set<String> setString = new set<String>();

2.How to create list of typeid in Apex?
 
List<id> idlist= new List<id>{'0015j00000AXYZWAA5','0015j00000AAPTRAA5'};


if you need any assistanse, Please let me know!!

Kindly mark my solution as the best answer if it helps you.

Thanks
Mukesh