Notifications
Announcements
No record found.
Hi,
If I want to create extension class or COC for a standard form's Init method, how can we access the form query ?
I tried to use this -> QueryBuildDataSource SalesTableQbds = this.form().query().dataSourceTable(tableNum(SalesTable)); but it is incorrect. I also tried to use keyword "queryBuildDataSource()" but I have no clue how to use it.
The purpose for this extension of Form's init method is to add a new datasource to its original query.
Thank you
Hi Axel Cage,
If you want to add datasource to the form. You can directly extend the form and add a datasource to it.
Is there any reason for adding datasource to the form via code?
Thanks,
Girish S.
The easiest way is SalesTable_ds.queryBuildDataSource().
By the way, please realize that "it is incorrect" says nothing about the actual problem. You should tell us what actually happened. For example, that you got a compilation error, at what place and what the error message said.
queryBuildDataSource() isn't a keyword. It's a method.
Yes, I eventually using SalesTable_ds.queryBuildDataSource(), I was in doubt before because the intellisense not working, it won't give me any suggestion. But I'm browsing and found someone also using this way, so I give it a try. I'm not sure why intellisense not working on this. the "incorrect" is the usual redline underlining my code.
The reason I'm adding using code is because there is some logic I need to add before adding datasource.
Thanks
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.
Martin Dráb 451 Most Valuable Professional
André Arnaud de Cal... 428 Super User 2025 Season 2
BillurSamdancioglu 239 Most Valuable Professional