Hi,
I have the following problem that I don't really understand. I have an event hook on the CustTable, which calls into a .NET class
[DataEventHandler(tableStr(CustTable), DataEventType::Updated)]
public static void CustTable_onUpdated(Common sender, DataEventArgs e)
{
CustTable ct = sender as CustTable;
var dispatcher = new Caller.Dispatcher();
dispatcher.Call(ct);
}
My .NET class has the following method
public string Call(Dynamics.AX.Application.CustTable cTable)
{
...
}
However, the compiler complains
Severity Code Description Project File Line Suppression State
Error Method 'Call(System.Object)' is not found on type 'Caller.Dispatcher'. ......
However, if I used this signature;
public string Call(Microsoft.Dynamics.Ax.Xpp.Common cTable)
{
...
}
It doesn't complain. If I have both methods, it will still call the Base (Common) one, rather than the CustTable method.
Can anyone shed some light on this?
Thanks, Jason
*This post is locked for comments
Excellent, many thanks for the help!
I'm certain this basic scenario of passing CustTable to a C# method accepting CustTable worked at some point, but trying it now it seems like indeed that doesn't compile, I'm seeing the same issue. I'm following up with the compiler team here and will update you when I get an answer.
On your question on polymorphism, I think I understand what you are asking but I think it's the same issue... if the compiler somehow considers common and CustTable as different types altogether, then that could lead to other issues. Speculation, let's fix the first issue first.
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,228 Super User 2024 Season 2
Martin Dráb 230,056 Most Valuable Professional
nmaenpaa 101,156