How do I perform locate on multiple keys on a xdatawebdataset ?
if dbBiocide.Locate('Customer_id;Sample_Date',
VarArrayof([mcustname.Value, mSampleDate.Date])) then
dbBiocide.edit
else
dbBiocide.Append;
It gives VarArrayof is not defined error at compile time. Added System.Variants in the uses clause
wlandgraf
(Wagner Landgraf)
March 9, 2020, 1:54pm
2
You can use it like this:
if dbBiocide.Locate('Customer_id;Sample_Date',
TJSArray.New([mcustname.Value, mSampleDate.Date])) then
dbBiocide.edit
else
dbBiocide.Append;
TJSArray is declared in unit JS.
I tried this but I am getting an error while compiling
[Error] InpBasic_Meq.pas(152): Incompatible types: got "array" expected "JSValue"
wlandgraf
(Wagner Landgraf)
May 13, 2020, 2:49pm
4
I'm sorry, this is the correct code:
uses {...}, Types;
var
Values: TJSValueDynArray;
begin
Values := [mcustname.Value, mSampleDate.Date];
if dbBiocide.Locate('Customer_id;Sample_Date', Values, []) then
dbBiocide.edit
else
dbBiocide.Append;