From 99d6abc3f2d1f331f689df0e2addc9cf08e7246d Mon Sep 17 00:00:00 2001 From: "Ouellette Jonathan (CSC FI SPS MESLEO)" Date: Tue, 30 Sep 2025 17:33:12 +0000 Subject: [PATCH] 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 --- LSL2/STPROC/RETURN_TO_FAB_SERVICES.txt | 84 ++++++++++++++------------ 1 file changed, 44 insertions(+), 40 deletions(-) diff --git a/LSL2/STPROC/RETURN_TO_FAB_SERVICES.txt b/LSL2/STPROC/RETURN_TO_FAB_SERVICES.txt index 12f3e88..cc77448 100644 --- a/LSL2/STPROC/RETURN_TO_FAB_SERVICES.txt +++ b/LSL2/STPROC/RETURN_TO_FAB_SERVICES.txt @@ -93,7 +93,7 @@ Service CreateReturnToFabRecord(CassId, UserId) end If NGLotId NE '' then //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 //Move in the lot Lot_Services('MoveInLot', NGLotId, UserId) @@ -165,48 +165,51 @@ Service CreateReturnToFabRecord(CassId, UserId) End Service -Service AddDefaultRTFOperations(LotId, UserId) +Service AddDefaultRTFOperations(LotId) ErrorMessage = '' - // Todo: add these to a configuration for return to fab. - CurrentOperationsSeq = Lot_Services('GetLotOperationSequence', LotId) - if CurrentOperationsSeq EQ '' then - CurrSeq = 0 + If LotId NE '' then + // Todo: add these to a configuration for return to fab. + CurrentOperationsSeq = Lot_Services('GetLotOperationSequence', LotId) + if CurrentOperationsSeq EQ '' then + CurrSeq = 0 + end else + CurrSeq = DCount(CurrentOperationsSeq, @FM) + end + Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_START', CurrSeq + 1, 'SYSTEM') + If Error_Services('NoError') then + Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_ASSIGN_REASON', CurrSeq + 2, 'SYSTEM') + end else + ErrorMessage = Error_Services('GetMessage') + end + If Error_Services('NoError') then + Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_ASSIGN_OPERATIONS', CurrSeq + 3, 'SYSTEM') + end else + ErrorMessage = Error_Services('GetMessage') + end + If Error_Services('NoError') then + Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_INIT_BIN_TO_BIN', CurrSeq + 4, 'SYSTEM') + end else + ErrorMessage = Error_Services('GetMessage') + end + If Error_Services('NoError') then + Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_DISPO', CurrSeq + 5, 'SYSTEM') + end else + ErrorMessage = Error_Services('GetMessage') + end + If Error_Services('NoError') then + Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_FINAL_BIN_TO_BIN', CurrSeq + 6, 'SYSTEM') + end else + ErrorMessage = Error_Services('GetMessage') + end + If Error_Services('NoError') then + Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_CLOSE', CurrSeq + 7, 'SYSTEM') + end else + ErrorMessage = Error_Services('GetMessage') + end end else - CurrSeq = DCount(CurrentOperationsSeq, @FM) + ErrorMessage = 'LotID Parameter was null.' end - Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_START', CurrSeq + 1, UserId) - If Error_Services('NoError') then - Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_ASSIGN_REASON', CurrSeq + 2, UserId) - end else - ErrorMessage = Error_Services('GetMessage') - end - If Error_Services('NoError') then - Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_ASSIGN_OPERATIONS', CurrSeq + 3, UserId) - end else - ErrorMessage = Error_Services('GetMessage') - end - If Error_Services('NoError') then - Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_INIT_BIN_TO_BIN', CurrSeq + 4, UserId) - end else - ErrorMessage = Error_Services('GetMessage') - end - If Error_Services('NoError') then - Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_DISPO', CurrSeq + 5, UserId) - end else - ErrorMessage = Error_Services('GetMessage') - end - If Error_Services('NoError') then - Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_FINAL_BIN_TO_BIN', CurrSeq + 6, UserId) - end else - ErrorMessage = Error_Services('GetMessage') - end - If Error_Services('NoError') then - Lot_Operation_Services('AddOperationToLot', LotId, 'RTF_CLOSE', CurrSeq + 7, UserId) - end else - ErrorMessage = Error_Services('GetMessage') - end - If ErrorMessage NE '' then Error_Services('Add', ErrorMessage) end @@ -1268,7 +1271,7 @@ Service MigrateLegacyRTFRecord(RTFRecordId) LotId = Lot_Services('CreateNewLot', CassType, '', '', '', '', '', 'SYSTEM', '', CassId) end If LotId NE '' then - Return_To_Fab_Services('AddDefaultRTFOperations', LotId, 'SYSTEM') + Return_To_Fab_Services('AddDefaultRTFOperations', LotId) If Error_Services('NoError') then //Now get all the created lot Operation records LotOperationIds = Lot_Services('GetLotOperationSequence', LotId) @@ -1321,3 +1324,4 @@ Service MigrateLegacyRTFRecord(RTFRecordId) end service +