Limit OneToMany rows

I’m in a situation where i need a Master/Detail form and the Detail ( multiple records ) number of rows must be limited by a field defined on a Master form.
In the specific i want to create a form where the user insert a product code and a quantity and after that a list of serial numbers limited by the quantity field.

Any idea on how to manage this?

depending on the database the way to do it is to use limit (sqlite/mysqlmariadb) / where rownum<… (oracle) etc…
And you should be able to use a variable for that then.
select … where rownum<[mymax] order by something

Only problem is that the limit statement is sometimes leading to syntax error depending on the state of the form. That’s a SC bug.

1 Like

I know how to populate and show already inserted records :slight_smile:
My question was how to represent only a certain number of rows in function of the quantity that is a field inserted in a given header in a master / detail form and the detail is a form with multiple records.

one2many.jpg