Found issue where iterator was being overridden by a nested foreach loop

This commit is contained in:
Infineon\Ouellette 2024-09-18 14:19:10 -07:00
parent 379abc36c7
commit e1442352c0

View File

@ -280,7 +280,7 @@ If ErrorMsg NE '' then
Return
end
RDSNo = NextKey('RDS')
RDSNo = NextKey('RDS')
errCode = ''
If RDSNo EQ '' or RDSNo EQ 0 or Error_Services('HasError') or Get_Status(errCode) then
@ -310,11 +310,11 @@ For each Layer in Layers using ','
// Look for related RDS_TEST records and delete them first
RDSTestKeys = Xlate('RDS_LAYER', RDSLayerKey, 'RDS_TEST_KEYS', 'X')
If RDSTestKeys NE '' then
For each RDSTestKey in RDSTestKeys using @VM setting vPos
For each RDSTestKey in RDSTestKeys using @VM
// Look for related TW_USE records and delete them first
TWKeys = Xlate('RDS_TEST', RDSTestKey, 'TW_USE_ID', 'X')
If TWKeys NE '' then
For each TWKey in TWKeys using @VM setting vPos
For each TWKey in TWKeys using @VM
Database_Services('DeleteDataRow', 'TW_USE', TWKey, True$, True$)
Next TWKey
end
@ -349,7 +349,7 @@ Next Layer
If RowExists('REACT_RUN', RDSNo) then
// Delete old CLEAN_INSP record(s) if they exist
CIKeys = Xlate('REACT_RUN', RDSNo, 'CI_NO', 'X')
For each CIKey in CIKeys using @VM setting vPos
For each CIKey in CIKeys using @VM
If RowExists('CLEAN_INSP', CIKey) then
Database_Services('DeleteDataRow', 'CLEAN_INSP', CIKey, True$, False$)
If Error_Services('NoError') then
@ -1471,3 +1471,4 @@ END
RETURN