Get or Create Sample

Sepasoft MES Module Suite

Getting or Creating Sample Definitions

Warning

Stable Version: 3.81.5 and later

Release Candidate: 3.81.4 RC6 and later

Python
#The following script sets a note and cause for a sample.
#You will need to pass the location path and sampleUUID for the sample that you are trying to add a note to.
locationPath = 'Nuts Unlimited\Folsom\Packaging\Packaging Line 1\Line 1 Quality' #You pass your location path
sampleUUID = '716c05dd-ae1c-4ca3-bc0b-ea51226afec3' #You pass your sampleUUID
sample = system.mes.spc.sample.getCreateByDefName(sampleUUID, '', locationPath)
print sample.getSampleUUID()
  
attrName = 'Broken' #You will need to replace this with the name of the attribute that the note is for
note = 'This is a New Scripted Sample note'
noteTaker = 'Phil'
cause = 'New Scripted Cause'
system.mes.spc.sample.setNote(sample, attrName, note, noteTaker)
system.mes.spc.sample.setCause(sample, attrName, cause, noteTaker) 
system.quality.definition.updateSampleDefinition(sampleDefinition)  






Sepasoft MES Module Suite