Re : Group Records

Re : Group Records

  
I need to group some records by an option. For example :

I have these records : 
Name : Adrian
Job : Engineer

Name: Joe
Job: Mechanic

Name: Karen
Job: Engineer


I want to show like that :

ENGINEER
     Adrian
     Karen

Mechanic
     Joe



Hello Willian,

What do you mean by group? Display based on Job, if yes you can just do a query to retrieve the persons based in a specific Job.
I am assuming that you have two entities, one for Jobs and other for Persons. 

Regards,
Hugo Pinheiro
Yes, I have two entities, one for Jobs and other for Persons.
I'd like to put for example, a header for each job and the content is the persons who has that job.

Example :

Header(Job)
Name
Name
Name
Name


Header(Job)
Name
Name
Name
Name


Header(Job)
Name
Name
Name
Name


Like a phone contacts :

A
Name
Name
Name
Name

B
Name
Name
Name
Name

C

Name
Name
Name
Name

D

Name
Name
Name
Name

E
Name
Name
Name
Name
Willian Antunes wrote:
Yes, I have two entities, one for Jobs and other for Persons.
I'd like to put for example, a header for each job and the content is the persons who has that job.

Example :

Header(Job)
Name
Name
Name
Name


Header(Job)
Name
Name
Name
Name


Header(Job)
Name
Name
Name
Name


Like a phone contacts :

A
Name
Name
Name
Name

B
Name
Name
Name
Name

C

Name
Name
Name
Name

D

Name
Name
Name
Name

E
Name
Name
Name
Name
 
You can achieve this by using an web block with a title and a list inside.
1 - Create a query to list all jobs in the preparation of the screen;
2 - Add a list record to the screen and bind the query from preparation (after create the web block you need to add it to the list record);
3 - Now create a web block that receive an Job Id and a Job Name as input parameters; 
4 - On the preparation of the web block you need a query to get all persons by job Id;
5 - Add a expression for Job Name and a list record to list all persons.

Let me know if this solution helped you!
Hugo Pinheiro wrote:
 
You can achieve this by using an web block with a title and a list inside.
1 - Create a query to list all jobs in the preparation of the screen;
2 - Add a list record to the screen and bind the query from preparation (after create the web block you need to add it to the list record);
3 - Now create a web block that receive an Job Id and a Job Name as input parameters; 
4 - On the preparation of the web block you need a query to get all persons by job Id;
5 - Add a expression for Job Name and a list record to list all persons.

Let me know if this solution helped you!
 
 
Hi,

Another solution, is to retrieve all the data in one query and format the display widget to show the Job label only if its different than the previous one. Here's an example with a List Records.


Regards,

Tiago.