One Custom object "SERVICE" have four record type, how to get without using URL?
NOTE: i have used the record type URL "RecordType=012D0000000V9q7&ent=01ID0000000RxJh" any other way to get record type kindly give any example or code
Id recTypeId = [select Id from RecordType where Name =: "Enter Record Type Name Here"and SobjectType =:" Enter SObject Name here" ]; e.g. [select Id from RecordType where Name =: 'SalesRep' and SobjectType =: 'Account'];
Schema.DescribeSObjectResult R = Account.SObjectType.getDescribe();
List<Schema.RecordTypeInfo> RT = R.getRecordTypeInfos();
For more details, refer the link below.
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_class_Schema_RecordTypeInfo.htm
All Answers
Schema.DescribeSObjectResult R = Account.SObjectType.getDescribe();
List<Schema.RecordTypeInfo> RT = R.getRecordTypeInfos();
For more details, refer the link below.
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_class_Schema_RecordTypeInfo.htm
One Custom object "SERVICE" have four record type, how to get without using URL?
NOTE: i have used the record type URL "RecordType=012D0000000V9q7&ent=01ID0000000RxJh" any other way to get record type kindly give any example or code
Thanks.
Id recTypeId = [select Id from RecordType where Name =: "Enter Record Type Name Here"and SobjectType =:" Enter SObject Name here" ];
e.g.
[select Id from RecordType where Name =: 'SalesRep' and SobjectType =: 'Account'];