You need to sign in to do that
Don't have an account?
Joe Hayes
Strings List to Map of Strings and Integers
This should be easy but I can't find a good answer for it.
I have a string e.g.
What I need to end up with is a list or map or something that has String and Integers
The above text will then be in a table like this so I can query and fetch values.
String Integer
Send Email 3
Laptops 5
Make Phone Call 2
At the moment I am doing the following:
This then gives me SendEmail;3;Laptops;5;etc
I'm just not sure how to do this properly and get it into a table.
The end goal is to for loop over the list/map and create tasks where subject is the string and activity date is system.today() + integer
Thanks
I have a string e.g.
String text = 'Send Email (3 Days Prior); Laptops (5 Days Prior); Make Phone call (2 Days Prior)';
What I need to end up with is a list or map or something that has String and Integers
The above text will then be in a table like this so I can query and fetch values.
String Integer
Send Email 3
Laptops 5
Make Phone Call 2
At the moment I am doing the following:
List<String> initialList = new List<String>(); initialList.addAll(venueTasks.split(';')); String initialListString = initialList.toString(); initialListString = initialListString.replaceAll(' (',';'); initialListString = initialListString.replaceAll(' Days Prior)','');
This then gives me SendEmail;3;Laptops;5;etc
I'm just not sure how to do this properly and get it into a table.
The end goal is to for loop over the list/map and create tasks where subject is the string and activity date is system.today() + integer
Thanks
I have solved your problem in my way and hope so I full filled all your requirments.
You can have a look in below code. I hope you find the above solution helpful. If it does, please mark it as the Best Answer to help others too.
Thanks and Regards,
Suraj Tripathi
All Answers
I have solved your problem in my way and hope so I full filled all your requirments.
You can have a look in below code. I hope you find the above solution helpful. If it does, please mark it as the Best Answer to help others too.
Thanks and Regards,
Suraj Tripathi
Works perfectly