GetEntity with two table join shows 4 rows, but the count is 2

GetEntity with two table join shows 4 rows, but the count is 2

  

Hello,

I have a GetEntity which join two tables. There is a sort on two columns. There are 4 rows returned.

But the Count says two only.

When the data is shown in a record list, only the even rows are show. Also running the data through a forEach also only iterates through the even rows of data.


Any ideas.

Hi Mark,

If you are seeing only even rows in table, check what is display style of odd rows. Is there any condition like "display:none;" in this style?


While iterating through foreach loop check what is source record list of loop. Is it from entity or from table?

Thanks and Regards,

Suraj Borade

Suraj,

Thank you for your reply.

For the records table Odd Lines are displayed the same as in your screen shot.

The problem is from the Entity Aggregate.

If you look at the screenshot enclosed you'll 4 rows. But the count for that aggregation is reported as being 2 only.

Hi Mark,

Did you confirm in the debugger that there are actually four rows returned when running the program? Your screen shot displays Service Studio, which uses hand-supplied test values (and I see you've got four of them). Might it be that runtime, both Count and the returned list contain 2?

Hello Kilian,


Thanks for your help in this problem.

In the test query there are 4 rows (and that's what the database should be returning). But at runtime the count is only 2 rows.

Hello Kilian,

In the query test each row has a unique ID



But only 2 rows are returned at run time.


But the IDs are different?



In fact, if I adjust my query so the test query only finds two rows, then the runtime query only finds one record.

Hi Mark,

Please share sample oml file.

Hello Suraj,

Thank you for your interest in my problem. It'll take me a bit of time to build a sample oml file.

And it's almost quitting time in my office (I'm in Japan). Please wait until tomorrow. 

Hi Mark,

If the Ids at runtime are different from the Ids in the test query, this means that your test values are different from the inputs* you get at runtime. Please check very carefully what the inputs are at runtime, and reproduce these as test values in Service Studio. I'm pretty sure the results will be the same then.

*I'm calling them inputs, as they are input variables to the query when it's sent to the database, but of course at runtime they are variables that live in your program that are also used by the aggregate.

I agree with Kilian sir.

Mark, if possible can you please provide screen print of TestValue section section.

Also please provide screen print of screen where you are seeing two records.

Thanks and Regards,

Suraj Borade

Gentlemen,

I too think there something funny with the code that is used at runtime.

I'll keep you posted if I can solve this problem.

Thank you for your help so far.