2 Antworten
Hi Srini, controller.getRecord() method will return sObject that represents the changes to the selected records. Case cas; //get record type id by recordtype label Id rtID=Schema.SObjectType.Contact.getRecordTypeInfosByName().get('RecordType label').getRecordTypeId(); cas=(Case)controller.getRecord(); cas.RecordTypeID=rtID; cas.OwnerID=UserInfo.getUserID(); public PageReference Save() { try{ if(cas!=null) { insert cas; } return New PageReference('/'+cas.id); } catch(Exception e){ ApexPages.addMessages(e); } return null; } Please let me know if it helps you. Best Regards, -Vivek