You need to sign in to do that
Don't have an account?
Erik Rodgers
Using sObject as a Map
I am fairly new to Apex and I am looking at some existing code in my Org written by a consultant. In one of our classes there is an sObject property/variable declared for a custom object. Later, in another method, I see lines of code where it appears the developer is using this sObject variable as a Map with the .put method.
Here are the declarations at the class level:
public Apttus_Proposal__Proposal__c newQuote{get;set;}
public String assignToParam{get;set;}
public Id assignToValue{get;set;}
And here is the assignment statement to which I was referring:
newQuote.put(assignToParam, assignToValue);
This makes no sense to me. Can someone please explain how this works or what it is doing to the sObject?
Thanks.
V/R,
Erik
Here are the declarations at the class level:
public Apttus_Proposal__Proposal__c newQuote{get;set;}
public String assignToParam{get;set;}
public Id assignToValue{get;set;}
And here is the assignment statement to which I was referring:
newQuote.put(assignToParam, assignToValue);
This makes no sense to me. Can someone please explain how this works or what it is doing to the sObject?
Thanks.
V/R,
Erik
Can you check that newQuote is not declared again within the method, as a map, otherwise the compiler would have given error and not allowed to save the class.
You just add one space adn again try to save the same class, it will throw you the error while saving ..if not then weneed to check the entire code why this is happening..please check and let us know the results..
Thanks,
Sandeep