You need to sign in to do that
Don't have an account?
alchemy
code
i have com e accross the following code
AssetRecTypes__c.getInstance('Retirement Accounts').Name
Here AssetRecTypes is a custom setting and Retirement Accounts is my Record Type Name.
but then this line is giving me an error
System.NullPointerException: Attempt to de-reference a null object
can i get a solution for it....
make sure you have inserted record in custom setting for "Retirement Accounts".
I believe the NULL pointer exception is because there is no record in custom setting for "Retirement Accounts".
but i dnt want NY VAUES IN BEGINING. IS DER ANY OTHER WAY OF PUTTING THE ABOVE CODE
You should incorporate error handling in the code.
i.e. you have to handle the Exception correctly.
try something like
String nm;
if(AssetRecTypes__c.getInstance('Retirement Accounts') != null)
nm = AssetRecTypes__c.getInstance('Retirement Accounts').Name;
Try this.