Welcome to my blog

I have been working with Salesforce for quite a while, so don’t hesitate to contact me if you have any questions or want some advice.

s f

Subscribe
Follow Us
h

How to convert Set Id to Set String in Apex code?

 . Apex  . How to convert Set Id to Set String in Apex code?

How to convert Set Id to Set String in Apex code?

Apex code is not supporting converting set to set direct way – we have to do workaround –

Set<Id> ids = new Set<Id>{'001G0000023lIWq','a61G0000000TOSE'};

Set<String> idStrs = (Set<String>)JSON.deserialize(JSON.serialize(ids), Set<String>.class);

System.debug('idStrings=' + idStrs);

Post a Comment