system.mes.getLotInfoByName

Sepasoft MES Module Suite

system.mes.getLotInfoByName(lotName, includeSublots, includeCustomProperties)

Get lot information including custom properties and sublots that belong to the lot.

Syntax

system.mes.getLotInfoByName(lotName, includeSublots, includeCustomProperties)

Parameters

String lotName - The lot name to return details for.

boolean includeSublots - If true, include sublot that belong to the lot.

boolean includeCustomProperties - If true, include custom properties for the lot, and if included, the sublots.

Returns

A dataset containing a row for each lot. If sublot are included, they reside in a dataset embedded in a column of the lot row. If custom properties are included, they will reside in a dataset embedded in a column of the lot or sublot rows.

Scope

All

Code Snippet

Python
 
#Get all of the information for material lots with a given name
ds = system.mes.getLotInfoByName('0000000073', False, True)
  
#Print available columns to access lot information
print 'Available columns to access Material Lot object information:'
for col in range(ds.columnCount):
    print ds.getColumnName(col)
  
#Cycle through each one
for row in range(ds.rowCount):
  
    #The CustomProperties column holds a dataset that has a row for each custom property
    cpDS = ds.getValueAt(row, 'CustomProperties')
     
    #This shows the column names of the custom property table
    #These are the available members of the custom property
    print
    print 'Available columns to access custom property information:'
    for cpCol in range(cpDS.columnCount):
        print cpDS.getColumnName(cpCol)
     
    print  
    print 'Custom property values:'
  
    #Print name - value of each custom property
    for cpRow in range(cpDS.rowCount):
        name = cpDS.getValueAt(cpRow, 'Name')
        value = cpDS.getValueAt(cpRow, 'Value')
        print '%s = %s' % (name, value)
                 
    #To change custom properties use the following
    lotUUID = ds.getValueAt(row, 'LotUUID')
    seqNo = ds.getValueAt(row, 'LotSequence')
    lotUse = ds.getValueAt(row, 'LotUse')
    if lotUse == 'Out' and seqNo == 1: 
        matLot = system.mes.loadMESObject(lotUUID)
        matLot.setPropertyValue('Viscosity', '11000')
        system.mes.saveMESObject(matLot)       


Output

Python
Available columns to access Material Lot object information:
LotUUID
LotName
LotSequence
LotDescription
LotEnabled
LotAssembly
LotStatus
LotAvailability
LotUnits
MaterialUUID
MaterialName
MaterialDescription
MaterialEnabled
EquipmentUUID
EquipmentName
EquipmentDescription
EquipmentPath
EquipmentEnabled
CustomProperties
Available columns to access custom property information:
MESPropertyUUID
ParentMESPropertyUUID
Name
Description
Value
ValueUnits
ValueDataType
Enable
Required
ProductionVisible
Custom property values:
Available columns to access custom property information:
MESPropertyUUID
ParentMESPropetyUUID
Name
Description
Value
ValueUnits
ValueDataType
Enable
Required
ProductionVisible
Custom property values:


 

 

Sepasoft MES Module Suite