---
title: "system.mes.trace.modifyOperation"
id: "system-mes-trace-modifyoperation-userid-name-begindatetime-enddatetime-equipment-workorder-material"
project: "MES User Manual"
url: "https://docs.sepasoft.com/articles/user-manual/system-mes-trace-modifyoperation-userid-name-begindatetime-enddatetime-equipment-workorder-material"
updated: 2026-10-01T18:15:14Z
---

# system\.mes\.trace\.modifyOperation

**Sepasoft MES Module Suite**

### system.mes.trace.modifyOperation

This method accepts keyword arguments. Modify an existing operation that was recorded with a user-provided id.

system.mes.trace.modifyOperation(userid, name, beginDateTime, endDateTime, equipmentPath, materialIn, materialOut, workOrder, personnel, supplementalEquipment, operationCustomProps, removeLot)

| ![Warning](/resources/Storage/user-manual/Warning.png) | **Version specific**<br><br>**MES 3.81.6 RC 3** **and later**<br><br>For version downloads, go to [https://www.sepasoft.com/downloads/](https://www.sepasoft.com/downloads/). |
| --- | --- |

| ![Note](/resources/Storage/user-manual/Note.png) | Version specific behavior:<br><ul><li>As of <b>MES 3.81.10 SP7</b> system.mes.trace.modifyOperation returns previous/next lots when deleting a material lot or changing the material of the lot. system.mes.trace.deleteOperation also deletes the material that was created by the operation.<br><br></li><li>As of <b>MES 3.81.11 SP7&#160;</b>system.mes.trace.modifyOperation increments the lot sequence number when the in lot and out lot are the same or when the out lot already exists.</li></ul> |
| --- | --- |

Syntax

system.mes.trace.modifyOperation(userid, name, beginDateTime, endDateTime, equipmentPath, materialIn, materialOut, workOrder, personnel, supplementalEquipment, operationCustomProps, removeLot)

* Parameters

**userid**; string Required This is a user-provided id that is used to specify the operation to modify.

**name** string Optional. Optionally include this if changing the name of the operation as it appears in the trace graph. Default: None

**beginDateTime** Optional: Optionally include if changing the begin date-time of the operation. Default: None

**endDateTime** Optional: Date Optionally include this if changing the end date-time of the operation. Default: None

**equipmentPath** Optional: String Optionally include if changing the equipment path where the operation occurred. Default: None

**materialIn** Optional: PyList

Only include material in items that are being changed. If modifying an existing material entry, the id is required. Otherwise, it is optional. Lot Array Entry: {'delete':False, 'UserID':'', 'Name':'', 'LotNo':'', 'MaterialName':'', 'Quantity':, 'UOM':'', 'Status':'', 'BeginDateTime': , 'EndDateTime': , 'EquipmentPath':'', 'ManifestName':'', 'LotCustomProperties': {}, removeLot}
Default: None

**materialOut**Optional: PyList

Only include material out items that are being changed. If modifying an existing material entry, the id is required. Otherwise, it is optional. Lot Array Entry: {'delete':False, 'UserID':'', 'Name':'', 'LotNo':'', 'MaterialName':'', EquipmentPath':'', 'ManifestName':'', 'Quantity':, 'UOM':'', Status:'', 'BeginDateTime': , 'EndDateTime': ,'LotCustomProperties': {}} LotCustomProperties Array Entry: {'Name':'', 'Value':, 'removeLot':True}
Default: None

**personnel** Optional: PyList

Only include personnel items that are being changed. If modifying a personnel entry, the id is required. Otherwise, it is optional.Personnel Array Entry: {'delete':False, 'UserID':'', 'Name':'', 'Person':'', 'Quantity': , 'UOM':'', 'BeginDateTime': , 'EndDateTime':}

Default: None

**supplementalEquipment** Optional: PyList

Only include supplemental equipment items that are being changed. If modifying a supplemental equipment item, the id is required. Otherwise, it is optional.Equipment Array Entry: {'delete':False, 'UserID':'', 'Name':'', 'EquipmentName:'', 'Quantity': , 'UOM':'', 'BeginDateTime': , 'EndDateTime':}

Default: None

**operationCustomProps** Optional: PyList

An optional array defining the custom properties associated with the operation. Custom Property Array Entry: {'Name':'', 'Value': }

Default: None

**removeLot** Boolean - Optional: Defaults to True. When true it deletes the Material Lot if the Material Lot is set for deletion. If set to false it only removes the reference from the segment. **Included in MES 3.81.10 SP9 and later.**

* Returns

Returns previous and next lots when removing or changing the material of the lot.

* Scope

All

| ![Note](/resources/Storage/user-manual/Note.png) | In MES 3.81.12 SP4, MES 4.83.1 SP4, and later, a material, person, or supplemental equipment added with `modifyOperation` and no dates uses the first date that is set: the date passed on the operation, then the date stored on the operation’s response segment, then the current time. |
| --- | --- |

**Sepasoft MES Module Suite**