You need to sign in to do that
Don't have an account?
deepa_tansen
How to create multiple record types in an object by mirroring one existing record type
Is there any way by using ANT or Eclipse we can create multiple record type in one object by mirroring one existing object?
I have to create more than 200 record types in one object and also asign the same page layout, profiles which is existing in one record type from which we are mirroring those record types.
Any help will be welcome.
Thanks,
Deepa
IMO, there is no such way to do that. You can vote on this idea:
https://success.salesforce.com/ideaView?id=08730000000BreSAAS
All Answers
IMO, there is no such way to do that. You can vote on this idea:
https://success.salesforce.com/ideaView?id=08730000000BreSAAS
Deepa,
Creating 200 record types by hand is obviously a pain. I would suggest looking at querying the existing record types and cloning them through some custom code:
So as an example, if your original object is Account,
List<RecordType> recTypes = [Select r.SobjectType, r.NamespacePrefix, r.Name, r.IsPersonType, r.Id, r.DeveloperName, r.Description, r.BusinessProcessId From RecordType r where SObjectType = 'Account']
String oldObjName = 'Account';
String newObjName = 'myObject';
for (RecordType recType : recTypes) {
RecordType newRecType = new RecordType();
newRecType.SObjectType = newObjName;
newRecType.Name = recType.Name.replace(oldObjName, newObjName)
newRecType.DeveloperName = recType.DeveloperName.replace(oldObjName, newObjName)
//etc
newRecTypes.add(newRecType);
}
insert newRecTypes;
I'm not sure about the Layouts. Anyway, worth trying this for the record types instead of trying to do it all by hand.
Best,
Ram