SQL Code to set Barcode?

Hello Again,

The last SQL code I got (thanks again) worked so well.....the new matrix in

2.0 is interesting; great in many ways, but now the "New Item Wizard" for matrix items does not set barcodes for the individual items, even if it is set on the first screen. Is there a SQL code to set barcodes for all items in our database, both existing and future? Please tell me there is, because otherwise we will be spending a lot of time adding it in.....

Thanks, Kat

Reply to
Kat Straub
Loading thread data ...

HI Kat, If I am not forgetting last time I given the code for this anyhow again take it may be someone else: This is database trigger which will update as soon as you insert the new item the barcode format type. the below 3 means the 3rd barcode from the list don't count "none" as it has value 0.

CREATE TRIGGER UpdBarcode ON Item FOR INSERT AS

UPDATE Item SET BarCodeFormat= 3 FROM Item INNER JOIN Inserted ON Item.ID= Inserted.ID

Rate me please.

"Kat Straub" wrote:

Reply to
Akber Alwani

Find an item that has the barcode type you want. Take note of the ILC.

From SO Admin: New query. SELECT ID, ItemLookupCode, BarcodeFormat from Item WHERE ItemLookupCode = 'insertYourILChere'

Take note of the BarcodeFormat.

If you want the same Barcode Format for all items, you could simply: UPDATE Item SET BarcodeFormat = X

If you want to be picky about which items get updated, use: UPDATE Item SET BarcodeFormat = X WHERE InsertYourCriteriaHere

Good luck, Tom

Reply to
Terrible Tom

Reply to
Kat Straub

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.