You need to sign in to do that
Don't have an account?

Get FieldType with dynamix apex
Hi Everyone,
I'm stuck.
I have an Sobject (contact,account or lead) and it's quite easy to get the data out of it.
SObject obj; String Input = string.valueof(obj.get('Phone'));
But now i need to know the field type as well. I thought it would be something like this. Please help.
Schema.SObjectField Fld = (Schema.sObjectField) obj.get('Phone'); Schema.DisplayType FldType = Fld.getDescribe().getType();
Thanks already!
Sten
Ok. Did it like this.
This works for me.
Thanks.
All Answers
Can you try ?
You can dynamically replace the field name.
Regards,
Ok. Did it like this.
This works for me.
Thanks.