• Keshava Praveen 15
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Is it possible to dynamically set class variable value?

I have a dynamyc form that should send the data to an external service (SOAP). The fields that are necessary depend on specific settings and can change. Can we set the Object attributes dynamically similar to how it's possible with sObject?

I would like to be able yo do someting like this:
public class dynForm {
    public String att1;
    public String att2;
    //additional attributes
}
dynForm myObject = new dynForm();
myObject.put('att1', 'value1');