Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

get or secure the next Lot Number from MESNumber Table

Step-by-step guide

use the following script :

def secureNextLotName():

	query = "SELECT Number FROM mesnumber where `key` = 'Lot'"
	mesDB = system.tag.getTagValue("[System]Client/System/DefaultDatabase")
	lotNum = int(system.db.runScalarPrepQuery(query,[],mesDB)) + 1
	query = "UPDATE mesnumber SET Number = ? where `key` = 'Lot'"
	system.db.runPrepUpdate(query, [lotNum], mesDB)
	lotName = str(lotNum)

	return lotName.zfill(10)
lotName = secureNextLotName()

print lotName

  • No labels