web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Detecting default parameters when calling next method in extension classes.

(1) ShareShare
ReportReport
Posted on by 87
Hello,
 
I have a technical issue that i think is important for a correct standard code preservation.
 
Let's say i have an standard class:
 
public class A
{
     public ExampleEDT test(String _a, String _b, boolean _c=false, boolean _d=false)
     {
          ExampleEDT      ret;
          if(primisDefault(_c) && primisDefault(_d))
          {
               //some if code
          }
          else
          {
               //some else code
          }
          
          return ret;
     }
}
 
Then i create a test() method extension:
 
[ExtensionOf(classStr(A))]
public class A_Extension
{
     public ExampleEDT test(String _a, String _b, boolean _c, boolean _d)
     {
          ExampleEDT ret;
         
          ret = next test(_a,_b,_c,_d);          
 
          return ret;
     }
}
 
 
I detected that, even when initially i call the test method 'a.test(string1, string2)' without using the extension, the standard code works as expected entering the first 'if', detecting _c and _d parameters as default. BUT, when using the extension it doesn't detect as default parameters. so the logic on the standard method doesn't work properly. (entering in the else part). The problem I see, is that I must call the next method using all the parameters (not only the mandatory) otherwise i get a runtime error.
 
In some cases, i can resolve this situation bringing the standard method logic to the extension's method, but in my opinion this is a bad practice since i am ignoring the standard code (and future changes).
 
 
I would like to know if there is any way to preserve the @_isDefaultSet property between extensions and standard classes
 
 
Thanks in advance,
Eisenberk.
 

 
I have the same question (0)
  • Layan Jwei Profile Picture
    8,165 Super User 2026 Season 1 on at
    Hi Eisenberk,

    I tried it now and faced the same thing. Maybe it's a bug that needs raising with Microsoft.
     
    Thanks,
    Layan Jweihan
    Please mark the answer as "Verified" if it solved your issue. In order to help others who will face a similar issue in the future
  • Basti Aurand Profile Picture
    268 on at
    I also faced this issue today. So it's still existing. No bugfixing from MS as far as I experienced. Is there any solution or is this just by design and we will have to do some workaround. What could be a workaround?
     
    I would realy appreciate any hints on this

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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 470

#3
Adis Profile Picture

Adis 270 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans