8
Views
4
Comments
Solved
Error if validation with datatable records
Application Type
Traditional Web

Hello guys i´m trying make one if for this validation: if the number of stock of the product which the user selected is 0, else the code send him messagebox saying "We dont have stock for that product".
It's always going for the true



VendasWeb.oml

Rank: #185
Solution

Hi Francisco, you will alway sget false as you are comparing with a list that is after your if as you can se in the pic bellow 


the agregate should come bbefore you use it for the if


you can check your oml attached

Hope I could help you

Cheers,

Carlos Lessa

VendasWeb1.oml

Rank: #94
Solution

Hello Francisco,

Hope you're doing well.

As you can see, your If condition is depending on GetStockByProductId Aggregate:

But you are running this Aggregate after the If condition:

So by the time the if condition is executed, the aggregate doesn't have any results. Therefore, it's always empty.

You should put your Aggregate before the If condition:


And are you sure it is always going for False branch? As I can see it is always going to True.

Nevertheless, this one should be very easy to find using debug :)


Hope that this helps you!


Kind regards,

Rui Barradas

Rank: #185
Solution

Hi Francisco, you will alway sget false as you are comparing with a list that is after your if as you can se in the pic bellow 


the agregate should come bbefore you use it for the if


you can check your oml attached

Hope I could help you

Cheers,

Carlos Lessa

VendasWeb1.oml