Hi,
i am writing a barcode reader app, which is basically scanning barcodes and then checking the dataverse table: contact for eg.
If the barcode is found in the table, then update a field, set it to true.
Else, if not found, create a new record with the value of that barcode in another table (which has 1 column: number).
Here is the code that i have created on the barcode reader component:
Set(
varScan,
First(Self.Barcodes).Value
);
Set(
varRecord,
LookUp(
'Asset Managements',
'Asset Number' = varScan
)
);
//checks if the asset number is equal to the variable scanned
/*If(
IsBlank(varRecord),
Set(
varRecord,
Defaults('Asset Managements')
)
);
*/
If(
IsBlank(varRecord.'Asset Number'),
/*Set(
varRecord,
Patch(
'Asset Managements',
varRecord,
{'Marche validée': false}
)
);
*/
/*
IsError(
Patch(
'Marcheur Non Reconnus',
Defaults('Marcheur Non Reconnus'),
{'Asset Number': varScan}
);), Notify("Error has occured",NotificationType.Error), Notify("Successful",NotificationType.Success)
*/
Patch('Not Recogniseds', Defaults('Not Recogniseds'), {number:varScan})
,
Set(
varRecord,
Patch(
'Asset Managements',
varRecord,
{'Marche validée': true}
)
);
);
/*
If(
IsBlank(varRecord),
Patch(
'Marcheur Non Reconnus',
Defaults('Marcheur Non Reconnus'),
{'Asset Number': varScan}
)
);
*/
Navigate(ButtonScreen);
my issue is that it is not creating the new record in the 'not recognised' table.
Please help.
Thank you