How to get a list of all orders and archived orders if order deleted

samantha73samantha73 Member Posts: 106
Hi all
I'm trying to extract a list of sales orders and archived sales orders (in case the order is deleted due to fully shipped/invoiced). Sales orders part is easy but getting the archived orders, I'm struggling to do this in AL code. In SQL I'd write a query something like:

Select Sales Archive Header.No where Sales Archive Header.No NOT IN (select No from Sales Order Header) and version = (Max (version) Sales Archive Header)



Answers

Sign In or Register to comment.