isCustom() method from Schema.DescribeFieldResult can be used to find whether the field custom or standard in Salesforce using Apex.
Sample Apex Code:
Schema.DescribeSObjectResult objectDescribeResult =
Account.sObjectType.getDescribe();
Map < String , Schema.SObjectField > mapFieldList =
objectDescribeResult.fields.getMap();
for (
Schema.SObjectField field :
mapFieldList.values()
) {
Schema.DescribeFieldResult fieldResult =
field.getDescribe();
if ( fieldResult.isCustom() ) {
System.debug(
'Field Label is ' +
fieldResult.getLabel()
);
System.debug(
'Field Name is ' +
fieldResult.getName()
);
}
}
Output: