Notifications
Announcements
i put a method on formdatasource level as below but it seems I can't call this method from the field DataSource level? as I'm getting this error: ClassDoesNotContainMethod: Class 'FormDataSource' does not contain a definition for method 'xxx' and no extension method '' accepting a first argument of type '' is found on any extension class. i tried four ways but all failed
1. How to fix it?
2. In general which way of the 4 is best to get formdatasource using CoC from ExtensionOf(formDataFieldStr?
2a. when do i use 'formRun' like this: FormRun formRun = element; FormDataSource table1_ds = formRun.dataSource(formDataSourceStr(Form1, Table1));
2b. when do i use 'element' like this FormDataSource table1DataSource = element.dataSource(formDataSourceStr(Form1, Table1)) as FormDataSource; 2c. when do i use 'this' like this FormDataSource table1_datasource = this.dataSource(); 2d. when do i use 'formDataObject' like this FormDataObject fdo = any2Object(this) as FormDataObject; FormDataSource fds = fdo.datasource();
There is something wrong with this reference in form datasource field extensions.
For example, I created an extension of CustGroup.Name in CustGroup form. The type of this seems to be FormDataObject - I see it in debugger and get it from classIdGet() and GetType().
But I can't assign it to a variable with FormDataObject type. Compilation fails with Cannot implicitly convert from type '$FormDataField_CustGroup_Name' to type 'FormDataObject'.
If you try this as FormDataObject, the compiler claims that this isn't a class.
A workaround of assigning this to an Object variable and then to FormDataSource works. Therefore the object is really an instance of FormDataObject.
(I reported this in the preview program forum in 2022. Unfortunately, nothing has changed.)
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Abhilash Warrier 679 Super User 2025 Season 2
André Arnaud de Cal... 421 Super User 2025 Season 2
Martin Dráb 282 Most Valuable Professional