You need to sign in to do that
Don't have an account?
Santi Ram Rai
I have create one Property which gets the RecordType from object..
Hi eveybody,
This is my Property in the apex class, which get the RecordType from the object. But it doesn`t work. Why? Please can you help me to fix it?
This is my Property in the apex class, which get the RecordType from the object. But it doesn`t work. Why? Please can you help me to fix it?
public List<String> ProjectRecordType{ get { if (ProjectRecordType == null) { ProjectRecordType = new List<String>(); Schema.DescribeFieldResult field = Project_Task__c.RecordType.Name.getDescribe(); for (Schema.RecordTypeInfo rt: field.getType()) ProjectRecordType.add(rt.getLabel()); } return ProjectRecordType; } set; } }
That is the preferred way [1] to get the record type informaiton.
[1] https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_Schema_RecordTypeInfo.htm
http://amitsalesforce.blogspot.in/2015/12/how-to-get-recordtypeid-without-soql.html Let us know if this will help you