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

Determining a field Data type
Hi Salesforce,
I'd like to be able to determine the datatype of a field name dynamic when user Passes the field Name. i.e., when user selects AccountNumber then we need to get the data type as Text, and when he again selects IsPartner on Account object then we need to get CheckBox as data type.
I think we can achive this with Describe Fields on the object and then match the name listed with a Map of the DescribeFieldResults.
As i am new to coding can any one give me the approch for this scenario with a sample code.
Thank you.
You can use the following code to determine the field type for a particualr object say Account
I guess this function will help you out :)
All Answers
You can use the following code to determine the field type for a particualr object say Account
I guess this function will help you out :)
Hi
First of all thanks for the reply. And this code has returned me with an Error
Error: Compile Error: unexpected token: 'String' at line 1 column 8
Thank You.
The code is working fine. i guess you forgot to notice that i gave you a method that has to be called to get the type of the field.