Hello there,


Currently I have a list screen and a table records which is populated by an aggregate and assign to a local list. Is there any where in my design/code that caused it to have duplicated records being displayed as shown in the attached photo/screenshot?


Thanks.

1. GetMovies is to populate the listbox.


2. ListAppendAll is to append all records retrieved from the GetPeopleWithPersonMovieRoles aggregate to display in table records.

Hi ZQ,
whenn you are using ListAppendAll function just before user ListClear and clear first testinglist and after that assign.

and also check your aggregate return duplicate record or its happening when you use ListAppendAll function.


Regards

Rahul Sahu

Hi ZQ,

Have you previewed the results of your Aggregate? Are the records already duplicated before they reach your local variable?

Also note that if you have any buttons or links with the Submit method set, your Preparation will be executed multiple times - if you do not clear your list or protect it with the IsLoadingScreen() function, you'll be appending to it multiple times.

Do you think you could share your module for everyone to review?

Afonso Carvalho wrote:

Hi ZQ,

Have you previewed the results of your Aggregate? Are the records already duplicated before they reach your local variable?

Also note that if you have any buttons or links with the Submit method set, your Preparation will be executed multiple times - if you do not clear your list or protect it with the IsLoadingScreen() function, you'll be appending to it multiple times.

Do you think you could share your module for everyone to review?

Hi Afonso,


Sorry for not providing enough info. Hereby attached is the oml for this little thing. :)


First of all it is valid if when you are doing append you have the variable cleared, otherwise you have an action to clear it. Then you should be able to control your results, what I advise you to do is things step by step, and with debugging see what comes out in each query, to be able to build a logic that makes sense for what you want.

ZQ wrote:

Hi Afonso,


Sorry for not providing enough info. Hereby attached is the oml for this little thing. :)


I can't publish because of missing references, but I assumed you were appending the result of GetMovies to your local variable. However, what's being appended is the output of GetPeopleWithPersonMovieRoles. This aggregate looks like it joins Person with Movie using PersonMovieRole - what I suspect is that this relationship is duplicating movies in your results, since you might have multiple Persons for the same Movie.

Looking at your Screen, could you use the GetMovies Aggregate instead? Without any joins it won't duplicate your movies.