Notifications
Announcements
No record found.
Hi Team,
I have created an extension class for SalesConfirmDP but got below error while rebuilding.
I guess, it is happening because of final keyword declaration. If yes , than how I can resolve this issue?
Pls give me more shed on this.
thanks!
What problem do you see there to solve?
Protected members are used with inheritance and you can't inherit from final classes. And there is no point in having anything else than a final class, because the extension class is instantiated by the system (in a very special way) and it would never use a child class if there was any. Therefore it's all as it should be.
Let me know how can I solve this? What changes are required?
I'm sorry, but I still don't know what you want to solve.
Hi,
In extension classes if you declare variables globally then you must give access specifier to a variables like below.
Public SalesConfirmDetialsTmp confirmDetailsTmp;
Public int i;
Public int serialization;
Thanks,
Girish S.
Thanks Girish,
Is it always public access modifier to declare in extension class?
Pls give me more shed on this
It depends on your requirement. Mostly it will be public only. If you declare it as public it will be accessible in all the methods.
Thanks Girish
The general recommendation is never using public instance variables. Such a design allows other classes to take dependency on implementation details of your class and it may harm maintainability and extensibility a lot.
Instead, expose the value through a public method. Then you can change the implementation (e.g. change the value how you store the data or add extra logic, such as raising an event on value change) without changing the public interface of the class.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 451 Most Valuable Professional
André Arnaud de Cal... 428 Super User 2025 Season 2
BillurSamdancioglu 239 Most Valuable Professional