loctSHAV.RESET; loctSHAV.SETRANGE("Document Type",loctSHAV."Document Type"::Invoice); loctSHAV.SETRANGE("Date Archived",0D,CALCDATE('<-1Y>',TODAY)); IF loctSHAV.FIND('-') THEN BEGIN locAktNo := 'START'; REPEAT locAktIsA := FALSE; IF locAktNo <> loctSHAV."No." THEN BEGIN locAktNo := loctSHAV."No."; IF loctSHAV."Posting No." = '' THEN BEGIN loctSIH.RESET; loctSIH.SETCURRENTKEY("Pre-Assigned No."); loctSIH.SETRANGE("Pre-Assigned No."); IF NOT loctSIH.ISEMPTY THEN locAktIsA := TRUE ELSE locAktIsA := FALSE; END ELSE BEGIN IF loctSIH.GET(loctSHAV."Posting No.") THEN locAktIsA := TRUE ELSE locAktIsA := FALSE; END; END; IF (locAktIsA = TRUE) THEN BEGIN loctSHAV.DELETE(TRUE); COMMIT; END; UNTIL loctSHAV.NEXT = 0; END;
Comments
sorry for bothering
delete post if possible
Thank u