You need to sign in to do that
Don't have an account?
rajesh k 10
Using FieldDescribeResult How to add account custom fields to Contact custom Fields without hardcoding?
Hi,
Using FieldDescribeResult How to add account custom fields to Contact custom Fields without hardcoding?
Using FieldDescribeResult How to add account custom fields to Contact custom Fields without hardcoding?
I try to below code for add person account custom field values to Contact with out hard coding but in person account custom fields end with __p and contact custom fields end with __c.
SObject contact;
Account account;
for(Schema.SObjectField objField : Schema.getGlobalDescribe().get('Account').getDescribe().fields.getMap().values())
{
if(objField.getDescribe().getName().endsWith('__pc'))
{
contact.put(objField.getDescribe().getName(), account.get(objField.getDescribe().getName()));
}
}
How to add person account custom field(Metadata fields) values to contact custom fields(Metadata fields)without hard coding?
please help me..