Purge SPC Data 3.0

Overview

Purging historical SPC data may be necessary when testing or if the data is no longer relevant.

Applies To and Version Info

This feature applies to SPC module and is available in version 1.8.1 and above.

Scripting


Code
sampleDefName = 'Nonconformity'
sampleDefObj = system.mes.spc.definition.getSampleDefinition(sampleDefName)
defUUID = sampleDefObj.getUUID()
priorToDate = system.date.addDays(system.date.now(),-15)
system.mes.spc.sample.purgeSampleData(defUUID, priorToDate)


The script above will remove only sample data.


If SPC is the only MES module used or if deleting all MES data (including other modules) is desired, you can set the data retention period on the gateway and the module will automatically trim all runtime data prior to the date provided.