Activity Forums Salesforce® Discussions How to get all email type field values?

  • Himanshu

    Member
    August 10, 2016 at 6:39 am

    Hi Tanu,

    String EmailFiels = '';
    for(Schema.SObjectField field : ObjectName.getSobjectType().getDescribe().fields.getMap().values())
    {
    if(Schema.DisplayType.EMAIL == field.getDescribe().getType())
    EmailFiels += ', ' + field.getDescribe().getName();

    }
    EmailFiels = EmailFiels.removeStart(',');
    you can get all the email type field of any object using the describe call.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos