Hi all,
we are trying to accomplish an automation where when the lifecycle stage of an item is in a specific stage and we have 0 qty on hand, o qty on order and the tier revision date is at least 2 weeks greater than our workdate we want to set the lifecycle stage to obsolete, check a box on our item card edi obsolete true, uncheck a box on our item card include on website and delete our item cross references for those items affected after 14 days.
additionally we have a need to uncheck default bins, fixed bins, and empty bins in the bin contents
our MS partner applied this object as a report to run however this is not doing anything after setting items to:
0 on hand in all locations
0 on purchase order
Compare date = at least 14 days from today’s date (07.30.19)
Tier revision date is set (07.30.19)
EDI obsolete is false
Include on website is true
I have tried setting my work date in nav to be in the future approximately 09.26.19 and running the item automation cleanup but I yield the same result.
Documentation()
OnInitReport()
OnPreReport()
OnPostReport()
Item - OnPreDataItem()
Item.CALCFIELDS(Inventory, "Qty. on Purch. Order","Qty. on Sales Order");
CompareDate := WORKDATE-14;
Item - OnAfterGetRecord()
Item."Lifecycle Stage" := 'OBSOLETE - DISC.';
Item."EDI Obsolete" := TRUE;
Item."Include on Website" := FALSE;
Item.MODIFY;
IF (Item."Tier Revision Date" < (CompareDate))
AND (Item."Tier Revision Date" > 0D)
AND (Item.Inventory = 0)
AND (Item."Qty. on Purch. Order"=0) THEN BEGIN
ItemCrossReference.RESET;
ItemCrossReference.SETRANGE("Item No.", Item."No.");
IF ItemCrossReference.FINDSET THEN
ItemCrossReference.DELETEALL(TRUE);
END;
Item - OnPostDataItem()
BinContent.RESET;
BinContent.SETRANGE(Default, TRUE);
IF BinContent.FINDSET THEN
BinContent.MODIFYALL(Default, FALSE);
BinContent.RESET;
BinContent.SETRANGE(Fixed, TRUE);
IF BinContent.FINDSET THEN
BinContent.MODIFYALL(Fixed, FALSE);
BinContent.CALCFIELDS(Quantity);
BinContent.SETRANGE(Quantity, 0);
IF BinContent.FINDSET THEN
BinContent.DELETEALL(TRUE);
can anyone confirm that this is the correct way to approach this? what would need to change?
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (