Hey there, I am trying to get my on scan property to add to the quantity of the scanned item if it's scanned multiple times, rather than adding more entries. I have no idea what I am doing wrong as the below seems to make sense but every scanned item goes in as a new record entry, help! - what am I missing here? - Here is what I've got:
Set(
CurrentRecord,
LookUp(
'Copy of catalogue - 07-20-2021',
Value(BarcodeScanner1.Value) = GTIN,
ThisRecord
)
);
Set(
Barcode1,
Value(BarcodeScanner1.Value)
);
Set(
Varscn,
true
);
Collect(
colLimit,
{
Limit: CurrentRecord.'Dried Flower Cannabis Equivalency',
Title: CurrentRecord.Title
}
);
If(
Sum(
colLimit.Limit,
Limit
) > 30,
Set(
varWarning,
true
)
);
If(
Sum(
colLimit.Limit,
Limit
) <= 30,
If(
CurrentRecord.GTIN = Barcode1,
Patch(
colShoppingCart1,
LookUp(
colShoppingCart1,
Barcode1 = Barcode,
ThisRecord
),
{
Qty: Qty + 1,
Title: CurrentRecord.Title
}
),
Collect(
colShoppingCart1,
{
Title: CurrentRecord.Title,
MemberID: VarMember,
ProductPrice: CurrentRecord.'Unit Price',
SKU: CurrentRecord.'OCS Variant Number',
Size: CurrentRecord.Size,
Barcode: CurrentRecord.GTIN,
Qty: Value(1),
Equiv: CurrentRecord.'Dried Flower Cannabis Equivalency',
Image: CurrentRecord.'Image URL',
Subtotal: CurrentRecord.'Unit Price',
Remain: CurrentRecord.'Eaches Per Master Case' - 1,
RemStock: CurrentRecord.'Eaches Per Master Case' - 1
}
)
);
Patch(
'Copy of catalogue - 07-20-2021',
CurrentRecord,
{'Eaches Per Master Case': CurrentRecord.'Eaches Per Master Case' - 1}
),
Remove(
colLimit,
Last(colLimit)
)
)