You need to sign in to do that
Don't have an account?

variable not visible ranjan234.CustomObjectFactory.userPrefsDefaults at line 23
currently i'm trying to upgrade salesforce API version from 20 to 42.0. i'm having issue with below code which was compiling successfully earlier.
please help with above compile error and why its not throwing error @ line 22
please help with above compile error and why its not throwing error @ line 22
public with sharing class CustomObjectFactory { public class UserPrefsDefaults { public final String name = 'User Preferences'; public final String bestBetsView = 'MBB'; public final Integer maxPages = 5; public final Integer timeFrameDays = 3; public final Boolean showWhatIsNew = true; } public static UserPrefsDefaults userPrefsDefaults { get { if(userPrefsDefaults == null) { Line 23-- userPrefsDefaults = new UserPrefsDefaults(); } return userPrefsDefaults; } } }
In that case do something like this:
All Answers
Try this code: Let me know if it helps.
Thanks
This is a very general coding pattern of function calls and their return type for any programming language.
To understand the whole construct of APEX language, refer this following link:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_dev_guide.htm
This link contains everything that you need to know about apex language.
Thanks
In that case do something like this: