Schema.DescribeFieldResult F = Account.Industry.getDescribe();
List<Schema.sObjectType> P = F.getReferenceTo();
====================================
// Create an account with predefined default values
Account acct = (Account)Account.sObjectType.newSObject(null, true);
// Provide a value for Name
acct.Name = 'Acme';
// Insert new account
insert acct;
===================================
Schema.DescribeFieldResult F = Account.Industry.getDescribe();
List<Schema.PicklistEntry> P = F.getPicklistValues();
===========================================
Schema.DescribeFieldResult F = Test__c.Box2__c.getDescribe();
List<Schema.PicklistEntry> P = F.getPicklistValues();
for(Schema.PicklistEntry obj:P)
{
system.debug('FieldLavel'+obj.getLabel()+'|FieldValue'+obj.getvalue());
}
No comments:
Post a Comment