Hi,
I am new to Navision / LS Retail we have classic client 2009 sp2.
I need a help ,in deleting items (almost 50,000) which does not have any transaction entry in Item Legder entry table
I tried it with two ways,
1.I Created a Code unit,
On Run Code:
item.reset;
if item.findset then repeat
itemledgentry.reset;
itemledgentry.setrange("Item No.",Item."No.");
if not itemledgentry.findfirst then
item.delete(true);
until item.next = 0;
Running this code unit is not skipping the records in Item ledger entry.
2.Created a report with data item ITEM Table
required filters : Date created,Inventory=0,Purcase qty =0,Sales qty =0,Division=value.
On aftergetrecord()
Item.Delete(True);
is also not skipping the Item Ledger Entry records.
Kindly help me...
Thank you.
0
Comments
Type Boolean.
FieldClass = Flowfield
Calcformula = Exist("Item Ledger Entry" WHERE (Item No.=FIELD(No.)))
Then we can filter on the items that do not have this field checked.
Select & delete - letting the item table (onDelete) take care of the rest.
http://www.BiloBeauty.com
http://www.autismspeaks.org
I will try to do as suggested.
But will it create Preaction as I need to maintain same data at stores as well.
I tried your suggestion ,It is working fine but taking almost 5 minutes to delete one single Item.
I have 50,000 Items to delete it will take long time.
So kindly suggest accordingly.
Best Regards
Abdul Haseeb