Hi Sunil,Below is the sample test class, I could not give you the exact one since I am not aware about mandatory fields and field api name in your org on given object, you just update my test class and use that. @isTest
private class CLASS_NAME {
@isTest(SeeAllData=true)
private static testMethod void testTrigger() {
Id ticketRecordTypeService = Schema.SObjectType.Ticket_Details__c.getRecordTypeInfosByName().get('Service').getRecordTypeId();
Id ticketRecordTypeSales = Schema.SObjectType.Ticket_Details__c.getRecordTypeInfosByName().get('Sales').getRecordTypeId();
Ticket_Details__c td1 = new Ticket_Details__c(Name = 'td1', RecordType__c = ticketRecordTypeService);
insert td1;
Ticket_Details__c td2 = new Ticket_Details__c(Name = 'td2', RecordType__c = ticketRecordTypeSales, Ticket_status__c = 'some valid value');
insert td2;
td2.Ticket_status__c = 'Another Valid Value';
update td2;
}
}
Update the field API name, picklist field value and record type name to query.
Mark solved if it does help you.Hi Rahul,Thanks for your help.With few modifications it was successfull.
2 answers