[ExtensionOf(formDataSourceStr(PurchTable, PurchTable))] internal final class FM_Datasource_PurchTable_PurchTable_Extension { [FormDataFieldEventHandler(formDataFieldStr(PurchTable, PurchTable, CurrencyCode),FormDataFieldEventType::Modified)] public static void onModified_CurrencyCode(FormDataObject _dataObject, FormDataFieldEventArgs _args) { _dataObject.datasource().modified_CurrencyCode(); } public void modified_CurrencyCode() { str x = 'test'; } }
I simply added an eventHandler where I call the method that I added to the class myself, but the compiler does not recognize the modified_CurrencyCode method and returns as error:
Error ClassDoesNotContainMethod: Class 'FormDataSource' does not contain a definition for method 'thisIsATest' and no extension method 'thisIsATest' accepting a first argument of type 'FormDataSource' is found on any extension class.
Does anyone know what could cause this issue?
Hi SuperBunny,
Don't combine event handler and COC in one class. It will be better if you create separate class.
For the issue try assigning the sender to Object and then call the datasource method.
[ExtensionOf(formDataSourceStr(PurchTable, PurchTable))] internal final class FM_Datasource_PurchTable_PurchTable_Extension { [FormDataFieldEventHandler(formDataFieldStr(PurchTable, PurchTable, CurrencyCode),FormDataFieldEventType::Modified)] public static void onModified_CurrencyCode(FormDataObject _dataObject, FormDataFieldEventArgs _args) { Object purchTable = _dataObject; purchTable.modified_CurrencyCode(); } public void modified_CurrencyCode() { str x = 'test'; } }
Thanks,
Girish S.
André Arnaud de Cal...
292,111
Super User 2025 Season 1
Martin Dráb
230,934
Most Valuable Professional
nmaenpaa
101,156