system.kanoa.quality.sheet.addChangeLog
Description
Adds a new change log record for a check sheet.Syntax
addChangeLog(changeInfo, userId)Parameters:
– changeInfo (dictionary): Details of the change to record.
– userId (int): User creating the change log entry.
Returns:
– changeLogId (int): ID of the inserted change log row.
– msg (string or None): None if success; error details on failure.
Dictionary
Parameter | Type | Required | Notes |
---|---|---|---|
chkShtId | int | Yes | Check sheet ID the change applies to |
change | string | Yes | Description of the change (required) |
Code Examples
# Add a change log entry
change = {
"chkShtId": 2002,
"change": "Updated instructions to include PPE check"
}
change_log_id, msg = system.kanoa.quality.sheet.addChangeLog(
changeInfo=change,
userId=123
)
print(change_log_id, msg) # e.g., 415, None
# Attempt with missing 'change' will return an error message
bad_change = {"chkShtId": 2002, "change": None}
change_log_id, msg = system.kanoa.quality.sheet.addChangeLog(bad_change, 123)
print(change_log_id, msg) # None, 'No change passed'