1

I am writing apex class to handel multiple objects triggers. My question is: Is here a way to get field of some kind of object assigned to sObject?

Exemple:

sObject kk = new Prouct(Name = 'Pro1');
kk.Name // this doesn;t work and i am looking for something n this place.

If i will find anything i will post here in mean time i ask for help.

0

1 Answer 1

4

The sObject class documentation provides a list of methods.

The one you're looking for is: get(fieldName)

In your case, the code would be:

sObject kk = new Prouct(Name = 'Pro1');
String name = kk.get('Name');
1
  • thx for help... Now i get how lame it was :D Thx any way Sep 12, 2017 at 10:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .