Announcements
No record found.
Hi Everyone,
I want to initialize a Form by grouping by a field. Example in the below form I want to initialize by grouping Absence code field. Please help me how to achieve this.
*This post is locked for comments
Each form has query, you can Group by using any field.
Modify your query and re-drag fields on design.
Thanks for your reply Sohaib,
can you give me an example code?
Hi,
have a look at next post,
msdn.microsoft.com/.../hh745337.aspx
When you create an AOT query, you can add a field in group by node.
After that you can add only required fields of adding all fields, under field nodes of query Datasource.
is that a customized or existing form?
in the init method of your datasource (on your form) after super set something like
this.query().datasourceTable(tablenum(YourDataSource)).addGroupByField(fieldnum(yourtable, yourgroupfield));
the problem with this is that some fields couldn't by grouped, for example on your firsts rows
1.-StickLeave 40
2.-StickLeave
when grouped the result will be
1.-StickLeave
and your last fiels do they have to be sum?
its a customized form
Hi Javier,
Yes your are right... the last two fields should be sum...
ex: sum of the "hours taken" by sick leave
THen you need add more lines like
this.query().datasourceTable(tablenum(YourDataSource)).addSelectionField(fieldnum(yourtable, yourgroupfield), SelectionField::Sum);
and repeat line for each sum field
thanks Javier, its worked
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.
Congratulations to our 2026 Super Stars!
We are thrilled to have these Champions in our Community!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
CP04-islander 39
Michel ROY 14
imran ul haq 8