Using LINKTOFILTEREDVIEW() to load a form with existing data

Ray
New Member

I am trying to scan a barcode and go directly to a View with a limited number of fields. In my case I want to add weights to records in an OrderDetails table.

I have set up a Scanner table and load a blank form to scan a barcode on the product that needs to be weighed. The form triggers an action that uses the LinkToFilteredView - it goes to a View with a row that matches the barcode value from the scanner to a barcode value that exists in the OrderDetails table.

My problem - If I direct the routine it to a form view the system seems to determine that adding a new record is the only option and generates a blank form. I can get the right display by using a detail view in the expression. But I would like to automate some actions when saving the form.

Is there a way to load the form with the data from the row that was matched by the barcode fields?

My code is: LINKTOFILTEREDVIEW(โ€œAddWeight_Detailโ€, [Barcode] = [_thisrow].[ScannedCode])

The AddWeight view is from a Slice that limits fields in the OrderDetails table. So Iโ€™m asking for records where the barcode in OrderDetails is equal to a record that is Scanned in ([Barcode]=[ScannedCode])

I tried the LINKTOFORM expression but could not get that to work either.

Thanks in advance for your time.
Ray

Solved Solved
0 5 612
1 ACCEPTED SOLUTION

Try:

LOOKUP([_THISROW].[ScannedCode], "OrderDetails", "Barcode", "key-column")

replacing key-column with the name of the key column of the OrderDetails table.

See also:

View solution in original post

5 REPLIES 5

Steve
Platinum 5
Platinum 5

Ray
New Member

Hi Steve - how would I get the KEY value? The barcode columns are not the key valuesโ€ฆ

Try:

LOOKUP([_THISROW].[ScannedCode], "OrderDetails", "Barcode", "key-column")

replacing key-column with the name of the key column of the OrderDetails table.

See also:

Hello

I'm having exactly the same issue as @Ray , but this solution doesn't work for me.

If I use a "detail" view as the target of LINKTOROW(), it works, and show the record I want, but if I use a "form" view (and that's what I want), it doesn't works, it shows a blank new record. Going further, just changing the type of view from detail to form (not creating a new view), and it stops to work. Changing back to detail, and it works again.

I have tried with LINKTOFILTEREDVIEW() as well, with exactly the same results

Ray
New Member

That is working the way I want it to. Awesome

My code is now:

LINKTOROW(
LOOKUP([_THISROW].[ScannedCode],โ€œOrderDetailsโ€,โ€œBarcodeโ€,โ€œOrderDetailIDโ€),
โ€œReceiveWaste_Formโ€
)

Thank you