function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AKASH KUMAR 82AKASH KUMAR 82 

how to check whether my page reference code is working in custom object(Position) or not

This is my apex code how to check in Position object it is working or not.I just want to check after clicking new it must go to IT record type or Non IT Record type
public class c1{
    List <Position__c> pstn = new List<Position__c>();

    public List<Position__c> getpstn(){
        return pstn;
    }

    public PageReference ITReport_pstn(){
        pstn = [select Name__c ,Type__c, Industry__c,  Phone__c from Position__c where Type__c = 'IT Report'];
        return null;
    }

    public PageReference NonITReport_pstn(){
        pstn = [select Name__c , Type__c, Industry__c,Phone__c from Position__c where Type__c = 'NonIT Report'];
        return null;
    }
}
AKASH KUMAR 82AKASH KUMAR 82
Anyone help fast please?
 
Arpit Gupta 37Arpit Gupta 37
Hi Akash,User-added image
Make a visual force page like above-replacing content according to yours, link the present custom controller to it.

Then go to position object and override the new button, you would have created with the above visual force page.

Regards:
Arpit Gupta



 
AKASH KUMAR 82AKASH KUMAR 82
Hi Arpit,
Thanx for ur reply i have created a visual force page just tell me how to override the new button?