Hi All,
I want to call the super in class extension .
Ex:super(_formControl, _filterStr);
How to I call this code in Extension Class.
It Would be great for your replay
Thanks
Arun Joseph A
*This post is locked for comments
Thank You.
Ya its throwing error.
public int active()
{
int ret;
if (mcrAllowPayment)
{
// Written some business logic
}
ret = super();
if (ret)
{
//Extension code .. call event handler extension class
}
In This how it will possible.
[FormDataSourceEventHandler(formDataSourceStr(LedgerJournalTransCustPaym, LedgerJournalTrans), FormDataSourceEventType::Activated)]
public static void LedgerJournalTrans_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
{
// How can i call here. if super extecuted here:
CustVendNACHAIATInfoTable_US.enabled(CustOutPaym_NACHA_IAT::isIATNACHAFormat(ledgerJournalTrans.PaymMode)); // this code want to executed.
}
Hi Arun
For what type of object do you want to create this class? Form, Table or another class?
If is a class the example that I've posted may help you, but it is another type of object you have to use eventhandlers, obviously the function will execute after or before (I think that would be the "super()" function that you are searching), depending of the event,
You may check next post
community.dynamics.com/.../ax7-extensibility-part-3-event-handlers-and-delegates-hooks
Regards.
Jose
Thanks
How to declare the super() in extension class.
Is there another way to call super() in class extension in D 365.
For EX:
[FormDataSourceEventHandler(formDataSourceStr(LedgerJournalTransCustPaym, LedgerJournalTrans), FormDataSourceEventType::ValidatingWrite)]
public static void LedgerJournalTrans_OnValidatingWrite(FormDataSource sender, FormDataSourceEventArgs e)
{
Super()// super not allowed here...
}
Hi Jose ,
Thanks for your reply.
For my Scenario:
public int active()
{
int ret;
ret = super();
return ret;
}
I want to Create the Extension class in D 365:
In extension class it did not to allow the super() call.
when I declare the super() its throws error in extension class.
Please help !
Thanks
Arun Joseph A
Hi Arun
If you extend a class you can override the functions, for example when you develop reports you extend the SRSReportDataProviderBase when you create your DP Class and override processReport() method.
The next may help you.
Noticed that both functions must have the same sign (parameters)
Class Main()
{
public void mainfunction(VendAccount _account)
{
// Do something for main function
}
}
Class Child extends Main
{
public void mainfunction(VendAccount _account)
{
super();//execute the mainfunction for mainclass
// Do something for child function
}
}
I hope this is what you are searching.
Regards
Jose Fuentes
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,232 Super User 2024 Season 2
Martin Dráb 230,064 Most Valuable Professional
nmaenpaa 101,156