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
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