You need to sign in to do that
Don't have an account?
edwin_beltran
string updateOpp(string oId, string fieldName, string fieldValue) {} - Is this possible?
Hi team,
I am trying to figure it out if this is possible?
WebService static string updateOpportunity(string oppId, string fieldName, string fieldValue) { try { integer i = Database.countQuery('select count() from Opportunity where Id = :oppId'); if (i > 0) { Opportunity o = [select :fieldName from Opportunity where Id = :oppId limit 1]; o.fieldName = fieldValue; update o; return 'OK'; } } catch (DmlException e) { return string.valueof(e); } }
someone gets the idea... is this possible?
please post or sms me.
You can do by following :-
o.put(fieldName, fieldValue);
All Answers
Try changing below line of code :-
Can I use?
o.fieldName = fieldValue;
What you think?
You can do by following :-
o.put(fieldName, fieldValue);
cool! I will test it right away...
happy code :)