Merged PR 27364: Modified the routine to add default RTF Operations to utilize SYSTEM in lieu...

Modified the routine to add default RTF Operations to utilize SYSTEM in lieu UserId. This is to avoid any issues with permissions for the ininitialization
This commit is contained in:
Ouellette Jonathan (CSC FI SPS MESLEO)
2025-09-30 17:33:12 +00:00
parent a2c467e9cb
commit 99d6abc3f2

View File

@ -93,7 +93,7 @@ Service CreateReturnToFabRecord(CassId, UserId)
end end
If NGLotId NE '' then If NGLotId NE '' then
//Assign default return to fab operations and move in. //Assign default return to fab operations and move in.
Return_To_Fab_Services('AddDefaultRTFOperations', NGLotId, UserId) Return_To_Fab_Services('AddDefaultRTFOperations', NGLotId)
If Error_Services('NoError') then If Error_Services('NoError') then
//Move in the lot //Move in the lot
Lot_Services('MoveInLot', NGLotId, UserId) Lot_Services('MoveInLot', NGLotId, UserId)
@ -165,9 +165,10 @@ Service CreateReturnToFabRecord(CassId, UserId)
End Service End Service
Service AddDefaultRTFOperations(LotId, UserId) Service AddDefaultRTFOperations(LotId)
ErrorMessage = '' ErrorMessage = ''
If LotId NE '' then
// Todo: add these to a configuration for return to fab. // Todo: add these to a configuration for return to fab.
CurrentOperationsSeq = Lot_Services('GetLotOperationSequence', LotId) CurrentOperationsSeq = Lot_Services('GetLotOperationSequence', LotId)
if CurrentOperationsSeq EQ '' then if CurrentOperationsSeq EQ '' then
@ -175,38 +176,40 @@ Service AddDefaultRTFOperations(LotId, UserId)
end else end else
CurrSeq = DCount(CurrentOperationsSeq, @FM) CurrSeq = DCount(CurrentOperationsSeq, @FM)
end end
Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_START', CurrSeq + 1, UserId) Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_START', CurrSeq + 1, 'SYSTEM')
If Error_Services('NoError') then If Error_Services('NoError') then
Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_ASSIGN_REASON', CurrSeq + 2, UserId) Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_ASSIGN_REASON', CurrSeq + 2, 'SYSTEM')
end else end else
ErrorMessage = Error_Services('GetMessage') ErrorMessage = Error_Services('GetMessage')
end end
If Error_Services('NoError') then If Error_Services('NoError') then
Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_ASSIGN_OPERATIONS', CurrSeq + 3, UserId) Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_ASSIGN_OPERATIONS', CurrSeq + 3, 'SYSTEM')
end else end else
ErrorMessage = Error_Services('GetMessage') ErrorMessage = Error_Services('GetMessage')
end end
If Error_Services('NoError') then If Error_Services('NoError') then
Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_INIT_BIN_TO_BIN', CurrSeq + 4, UserId) Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_INIT_BIN_TO_BIN', CurrSeq + 4, 'SYSTEM')
end else end else
ErrorMessage = Error_Services('GetMessage') ErrorMessage = Error_Services('GetMessage')
end end
If Error_Services('NoError') then If Error_Services('NoError') then
Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_DISPO', CurrSeq + 5, UserId) Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_DISPO', CurrSeq + 5, 'SYSTEM')
end else end else
ErrorMessage = Error_Services('GetMessage') ErrorMessage = Error_Services('GetMessage')
end end
If Error_Services('NoError') then If Error_Services('NoError') then
Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_FINAL_BIN_TO_BIN', CurrSeq + 6, UserId) Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_FINAL_BIN_TO_BIN', CurrSeq + 6, 'SYSTEM')
end else end else
ErrorMessage = Error_Services('GetMessage') ErrorMessage = Error_Services('GetMessage')
end end
If Error_Services('NoError') then If Error_Services('NoError') then
Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_CLOSE', CurrSeq + 7, UserId) Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_CLOSE', CurrSeq + 7, 'SYSTEM')
end else end else
ErrorMessage = Error_Services('GetMessage') ErrorMessage = Error_Services('GetMessage')
end end
end else
ErrorMessage = 'LotID Parameter was null.'
end
If ErrorMessage NE '' then If ErrorMessage NE '' then
Error_Services('Add', ErrorMessage) Error_Services('Add', ErrorMessage)
end end
@ -1268,7 +1271,7 @@ Service MigrateLegacyRTFRecord(RTFRecordId)
LotId = Lot_Services('CreateNewLot', CassType, '', '', '', '', '', 'SYSTEM', '', CassId) LotId = Lot_Services('CreateNewLot', CassType, '', '', '', '', '', 'SYSTEM', '', CassId)
end end
If LotId NE '' then If LotId NE '' then
Return_To_Fab_Services('AddDefaultRTFOperations', LotId, 'SYSTEM') Return_To_Fab_Services('AddDefaultRTFOperations', LotId)
If Error_Services('NoError') then If Error_Services('NoError') then
//Now get all the created lot Operation records //Now get all the created lot Operation records
LotOperationIds = Lot_Services('GetLotOperationSequence', LotId) LotOperationIds = Lot_Services('GetLotOperationSequence', LotId)
@ -1321,3 +1324,4 @@ Service MigrateLegacyRTFRecord(RTFRecordId)
end service end service