Dear User,
i have been given a work in which same no of item no. should not come suppose if a user has 1 item no. 1011001002 now other user also have item no 1011001002 so i have to make the report in which that other users particular data should be deleted see the example given below
| User ID |
Item No. |
| ABHAY |
1011001002 |
| ABOHAR |
1011001002 |
| ADMINISTRATOR |
1011001004 |
| AGRA |
1011001004 |
| AGRA2 |
1011001005 |
| AGRA4 |
1011001007 |
| AJAY |
1011001008 |
| AJEET |
1011001009 |
| AKASH |
1011001009 |
| ALIGARH |
1011001010 |
| ALIGARH2 |
1011001010 |
| ALLAHABAD |
1011001011 |
| AMAN |
1011001012 |
| AMBALA |
1011001013 |
| AMIT_ACC |
1011001013 |
| AMRITSAR |
1011001014 |
| ANDHRAP |
1011001014 |
hi,
try
// table userItemLoc contains the data
IF userItemLoc.FINDSET THEN
REPEAT
IF itemNo = userItemLoc.“Item No.” THEN
userItemLoc.MARK(TRUE)
ELSE
itemNo := userItemLoc.“Item No.”;
UNTIL userItemLoc.NEXT = 0;
userItemLoc.markedonly(true);
userItemLoc.deleteall;
best regards
Dear Kalchmair,
Thank you for the response i have try this code and it is working fine i will try your solution as well.
MyItem.RESET;
MyItem.SETFILTER(“User ID”,’<>%1’,“User ID”);
MyItem.SETRANGE(“Item No.”,“Item No.”);
IF MyItem.FINDFIRST THEN
REPEAT
MyItem.DELETE;
UNTIL MyItem.NEXT = 0;
Best Regards,
Abuzar
hm,
your code would work if you want to get the records with an User ID different from the current User. if you really want to delete/change items within the loop you should use findfirst(true,false). but give it a try.
regards
frank