There is any way to override private method in class extension ?
I made a class extension and I want to override method but its private method , How Can I access it ?
No, you can't extend private methods. You'll need to design a different solution.
Have you checked this thread
community.dynamics.com/.../881069
As Martin mentioned you can't extend private method, either raise extensibility request to Microsoft but high chances the request won't be approved easily as Microsoft made those methods private for reason.
FYI, we raised extensibility request few months ago, none of it is approved.
You can duplicate the method and call that method instead of calling standard method.
But keep in mind, in future if Microsoft release any updated on that method it won't update on your custom method.
Thanks,
Girish S.
How to duplicate the method , I want to change some logic in private method in class .
I made a class extension , How to duplicate method ?
I tried to make new method have same logic and change what I need , but when I debug doesn't enter class extension .why ?
Does the symbol loads correctly?
Place the debugger point inside the method and check.
After the symbol is loaded the debugger point becomes red and it won't show any warnings.
Hi Menna, Can you please explain the requirement and which private method you are trying to override? jumpref is a public method in InventJournalTableJumpRefHelper class.
Also you don't need to copy entire method in extension class. After 'next jumpRef' line you should add your logic and like Girish mentioned if sysmbols are loaded correctly, this method should be called.
Hi Mohit , My requirement is to change the menu item name that called in jump ref method , but menu item name () is a private method in InventJournalTableJumpRefHelper class so to change that I wrote a new public method in class extension and change the menuitemname () in jump ref to my new method but class extension didn't called when I debug
Hi Menna, You can create a copy of main method of InventJournalTableJumpRefHelper class and rename and replace menuItem name in getMenuItemName method's parameter.
Create extension class of InventTransRefId field in ITMOverUnderTransLine datasource in ITMOverUnderTrans form. For reference you can check below thread
community.dynamics.com/.../extension-class-of-form-datasource-field-method
Create Coc method for JumpRef and before 'next JumpRef' change ITMOverUnderDocType to any other value so it will bypass standard jumpRef code later. Copy jumpRef code in your method and replace call to Main method with your new method.
Please note that its not an ideal approach and not recommended by Microsoft as it will require to bypass standard method and creating your own methods. So, in future if MS releases any update to these objects, your customizations will impact.
Hi Mohit , Thanks for your replying but I want to ask you a question , when I opened InventJournalTableJumpRefHelper class the menuItemName() method called in jumpref() method not in main method so How Can I Change it in main() method , In getmenuItemName(tableBuffer) method I want to change logic in it change returned name from it not parameter . Can you explain it ?
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 Pallavi Phade as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 650 Super User 2025 Season 2
Martin Dráb 582 Most Valuable Professional
CU05031448-0 526