I have a function that is taking the No. value in the Item table and writing the value to a new table I created called 'Blocked Items'. The items going in this table are the items that are 'Blocked' = TRUE in the 'Item' table. Once the item list is in the 'Blocked Items' table then I set all 'Item.Blocked' = FALSE. This is so I can do a compare and set 'BLOCKED' = TRUE for the same items at a later time. The function I have setting 'Blocked' = TRUE the items is below:
IF "Blocked Items".FINDSET THEN BEGIN
REPEAT
Statement := FALSE;
IF Item.FINDSET THEN BEGIN
REPEAT
IF "Blocked Items"."No." = Item."No." THEN BEGIN
Item.Blocked := TRUE;
Item.MODIFY;
Statement := TRUE;
END;
UNTIL (Item.NEXT = 0) OR (Statement = TRUE);
END;
UNTIL "Blocked Items".NEXT = 0;
"Blocked Items".DELETEALL;
MESSAGE('Items reblocked.');
END
ELSE BEGIN
MESSAGE('No items to block exist.');
END;
The problem that I am having is that without the DELETEALL everything works as it should setting 'Blocked' = TRUE the corresponding items in the 'Item' table. Once I add the DELETEALL it doesn't set 'Blocked' = TRUE the items but the items in the 'Blocked Items' table are deleted. What am I doing wrong?
Answers
But maybe I am missing the point here.
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community
I have used the following code:
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community
Mark the post as Solved 8)
Never stop learning
Van Vugt's dynamiXs
Dutch Dynamics Community