+ Start a Discussion
moverdorfmoverdorf 

How To See If A Custom Setting Exists in an ORG...

What is the code to use to check for the existence of a Custom Settting?
Some of my clients ORGs may not have setup the custom setting and I want my code to set a default if no custom setting exits.

Psuedo Code:
If (mycustomsetting == null) this is the piece of code I want to know how to check
{
 days = 100;
}
else
{
 days = mycustomsetting....
}

My Custom Setting is
Best Answer chosen by moverdorf
NagaNaga (Salesforce Developers) 
Hi Moverdorf,

Describeobject can perhaps help you on this.(Instance methods)

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_sobject_describe.htm

You can also see the post below

https://developer.salesforce.com/forums/ForumsMain?id=906F00000008xU4IAI

Best Regards
Naga kiran