Hi suraj,
I have used “ob” to show the new record. Therefore it should be inserted in the Save function.
___________________________________________________________________________
public class Test {
public Test ob {get;set;}
public Test(ApexPages.StandardController controller) {
Contact c = (Contact)controller.getRecord();
ob = new Test();
ob.Contact__c = c.Id;
}
public PageReference save() {
insert ob;
PageReference pg = new ApexPages.StandardController(ob).view();
pg.setRedirect(true);
return pg;
}
}
Thanks.