Hi everyone
I've implemented a new method on a form datasource by extension (on the SalesLine datasource of the SalesTable form to be exact).
When I call the method however, I get this error message:
"Error executing code: FormDataSource object does not have method "xxx""
I couldn't find much documentation on how to do it, but eventually found these:
I understand the principle of casting a FormDataSource object to a more generic/super object. Yet when I implement it, I get an error. Here is my implementation:
[ExtensionOf(formDataSourceStr(SalesTable, SalesLine))]
final class SalesTableDSSalesLine_Extension
{
public void blah(boolean _variable)
{
// do something
}
}
and the call:
[FormDataFieldEventHandler(formDataFieldStr(SalesTable, SalesLine, ItemId), FormDataFieldEventType::Modified)]
public static void ItemId_OnModified(FormDataObject sender, FormDataFieldEventArgs e)
{
Object dsObject = sender.datasource();
dsObject.blah(true);
}
The only difference I can see is that other implementations are calling this from a form control, and not a form data field control, but surely that makes no difference.
The error message seems to indicate that the cast isn't happening properly: It's calling the method off an 'Object' object, but it still says that the method doesn't exist for 'FormDataSource' objects - strange.
What am I doing wrong?
Any help appreciated.