You need to sign in to do that
Don't have an account?
Shwetal Desai
Override Custom Object Tab by its Edit URL
I have one custom object. only one record will be there in that custom object.
Now there is one Visual force page for my custom object which i need to open on the click of Tab of the object but with that value in all inputText and other inputComponent.
i.e. If there is no record found in the object then "save" button will insert the new record else update the existing one.
How can i do this?
Thanks in Advance
Now there is one Visual force page for my custom object which i need to open on the click of Tab of the object but with that value in all inputText and other inputComponent.
i.e. If there is no record found in the object then "save" button will insert the new record else update the existing one.
How can i do this?
Thanks in Advance
any guidance?
Okie.........
i ll try this and let u know tomorrow.
Thank you for guiding me...
APEX CODE:-
public class Setup
{
Companypref__c cmp;
public Companypref__c getcmp()
{
Companypref__c cmpref = [select Id from Companypref__c];
if (cmpref == null)
{cmp = new Companypref__c();}
else
{cmp = new Companypref__c(ID = cmpref.Id);}
return cmp;
}
public String locationId,company,address,city,state,country,phone,fax;
public Double zip;
public ID fedemp,stateemp;
public String getlocationId()
{
locationId = cmp.LocationId__c;
return locationId;
}
public void setlocationId(String lid)
{
locationId = lid;
}
public String getcompany()
{
company = cmp.Company__c;
return company;
}
public void setCompany(String c)
{company = c;}
public String getaddress()
{
address = cmp.address__c;
return address;
}
public void setaddress(String ad)
{address = ad;}
public String getcity()
{
city = cmp.City__c;
return city;
}
public void setcity(String ct)
{city = ct;}
public String getstate()
{state = cmp.State__c; return state;}
public void setstate(String st)
{state = st;}
public String getcountry()
{country = cmp.Country__c;return country;}
public void setcountry(String cn)
{country = cn;}
public Double getzip()
{zip=cmp.Zip__c;return zip;}
public void setzip(Double z)
{zip = z;}
public String getphone()
{phone = cmp.Phone__c; return phone;}
public void setphone(String p)
{phone = p;}
public String getfax(){fax=cmp.Fax__c;return fax;}
public void setfax(String f){fax= f;}
public ID getfedemp(){fedemp = cmp.FedEmpId__c;return fedemp;}
public void setfedemp(ID fe){fedemp = fe;}
public ID getstateemp(){stateemp = cmp.StateEmpId__c;return stateemp;}
public void setstateemp(ID se){stateemp=se;}
}
if i use this code for my VF page it gives me error:
"System.NullPointerException: Attempt to de-reference a null object
Class.Setup.getlocationId: line 41, column 18
External entry point "
where i did mistake in code?