+ Start a Discussion

Set global variable dynamically

global class test {
global String var1;
global String var2;
global String var3;

What i want to do is to set this variables dynamically like : 
for(List<String> value: values){
 test[value] = '1'; 

Where value is var1, var2, var3

Best Answer chosen by Maxime
AnudeepAnudeep (Salesforce Developers) 
Hi Maxime - Similar question is posted here already. I recommend looking at the suggestions