You need to sign in to do that
Don't have an account?
Robin Barnwell 3
JSON Class Definition
Is this possible in Apex..........
I have set-up a Customer Setting and can access the values through a simple For list:
I have set-up a Customer Setting and can access the values through a simple For list:
List<MailchimpInterests__c> Interests = MailchimpInterests__c.getall().values();
for (MailchimpInterests__c X : interests) {
system.debug(x.interestname__c);
}
system.debug(x.interestname__c);
}
I want to use the values in the List to populate a JSON Class. So rather than having to "Hard Code" it like this:
public class Interests {
public Boolean 5d73033083;
public Boolean 5f4a42fad6;
public Boolean 81fa33ee25;
public Boolean eb61f508b8;
public Boolean 67f41d1b49;
public Boolean 1b911e7209;
public Boolean 2c689eb6b3;
}
I would prefer some magic happened like this:
public class Interests {
My dynamic List of Values from the Custom Setting
}
Is this possible? The reason being the interest list will change over time.
public class Interests {
public Boolean 5d73033083;
public Boolean 5f4a42fad6;
public Boolean 81fa33ee25;
public Boolean eb61f508b8;
public Boolean 67f41d1b49;
public Boolean 1b911e7209;
public Boolean 2c689eb6b3;
}
I would prefer some magic happened like this:
public class Interests {
My dynamic List of Values from the Custom Setting
}
Is this possible? The reason being the interest list will change over time.
public String id;
public String email_address;
public String status;
public Merge_fields merge_fields = new Merge_fields();
public Map<String, Boolean> interests = new Map<String, Boolean>();
}
Assignment is via using the class e.g.
Getting there.