How to display added records in a records list of an especific functional area ?

I have to show the added records in an annoucements list.

There are some Functional areas with departments. Each  department has an Id. e.g(marketing, finance, human resources)

Users can create annoucements for the departament the he belongs to.The added annoucement must be 

displayed in a list of annoucements reffering to the department of the current user.


I've created some logical for that, but the added annoucements are not being displayed in the reffering department even though the destination of the screen is correct.




Hi Raissa,

If I understand your question, you have a registration list, and you are adding new registrations and they are not appearing, did I understand your question well?

If this is the case, you have to refresh the query as well as refresh the container where you have the list record.

Regards,
Nuno Verdasca

You have another way, which makes it faster for the user, and with which you do not need to refresh the query, which is first make Create, and then make listAppend to the screen list.


But both solutions work.

Once again, if I understand your question well.

Best regards,

Nuno Verdasca

Nuno Miguel Verdasca wrote:

Hi Raissa,

If I understand your question, you have a registration list, and you are adding new registrations and they are not appearing, did I understand your question well?

If this is the case, you have to refresh the query as well as refresh the container where you have the list record.

Regards,
Nuno Verdasca


Nuno, The records are being created but they're displayed in another screen (not the screen I want to show). It happens that destination screen is the right one. Any idea of what could be?

Hi Raissa,

If I understand, the records are being created in the correct table (validate that the CRUD actions are well done and are referencing the tables well, I deduce).

So if you create a record in a table, and you say you go to the table validate the record and it is there ... I wonder if you are changing any assignments? That other screen that you say is where the new records are appearing, has a list record of the same table as the screen you are using to create?

So you create a record, it does not appear on the screen that should appear, but appears in the right table, and when you navigate to another screen, does that record already appear there? When you go back to the screen where you want to create and show the records, don't those new records appear?

Regards,
Nuno Verdasca

Nuno Miguel Verdasca wrote:

Hi Raissa,

If I understand, the records are being created in the correct table (validate that the CRUD actions are well done and are referencing the tables well, I deduce).

So if you create a record in a table, and you say you go to the table validate the record and it is there ... I wonder if you are changing any assignments? That other screen that you say is where the new records are appearing, has a list record of the same table as the screen you are using to create?

So you create a record, it does not appear on the screen that should appear, but appears in the right table, and when you navigate to another screen, does that record already appear there? When you go back to the screen where you want to create and show the records, don't those new records appear?

Regards,
Nuno Verdasca

Nuno, when the User logs in, the system should get the id of the logged user department. This way, when he create a new annoucement, it should be displayed in the announcement list of the logged user department. Got it?

I've try to solve this problem. I've set manually the id of UserDepatment and now it works. But it should be done automatically by the system.

Hi Raissa,


If I understand what you want, you have a page where you can post ads or comments, and the only user who can delete that comment is the user who wrote it.

Then in the table that records the comment, you record some more information like the date it was posted, and who posted the comment, and this who, is a user who has an ID in the USERS table.

You on the delete button, which by default is usually a trash can, you can only place visible when the person on the page that has that ID, otherwise you can not delete the ad.


As for wanting to show a user only comments from users in his or her department, you can create a USERs table extension, where you add an attribute that will be the department ID, assuming you also have a static table with departments , and they have an ID (advice, these IDs should not be auto number, because if when passing environment, the IDs may be different).

Now, in the ad table you add the department id attribute, and when you are querying to fetch the filtered ads for ads that have the department ID equal to the department ID that is associated with the user.

Does this solution help you?


Best regards,
Nuno Verdasca

Solution

Hello Raissa,

I see two options.

1. Before you execute the aggregate that fetches the announcements, you execute another one, that fetch the User information (DepartmentId), and use this to filter the announcements aggregate.

2. You do an inner join (only with) of the user entity (the one that has the user department id) with the announcement table, and filter the lines by the user Id.

3. You add an "On Session Start" system action to the module where is the page that you want to shoe the list (see image below), and on this action you fetch the user information to get the Department Id and store it in a session variable, that you use to filter the aggregate that fetches the announcements.

Hope this also helps you find a good solution for your context.

Cheers.

Solution

Thank you Nuno and Eduardo for the replies! It helped me a lot!! Finally got it

Cheers.