I currently have code which checks when a user tries to delete a item from released production order's and errors If there are currently picked items. I then ask the user if they want to Unpick these items. How would I go about Writing this.
I figure I need to get the routing lines for the production order and then call a function called "Unpick" for example (I have one created for this)
"For each routing line, call the relevant function with the routing link code (SMT, TH etc) from the Routing Lines above."
These are the filters I use on the Routing page
This is my code so far
recWarehouseEntry.SETRANGE("Source No.","No.");
IF recWarehouseEntry.FINDFIRST THEN
CONFIRM('Cannot delete as there are picked items. Do you wish to unpick?', FALSE) = TRUE THEN
Any and all feedback is appreciated!
*This post is locked for comments
You need to pass the record variable as 5406 (Prod. Order Line) not 5405.
Instead of rec, try to pass recProdLine variable. It should work.
Thanks, I've chosen a different direction however I've cam across this error. Any idea how to solve it I'm net to trying to pass the functions across.
Hi,
Upon confirmation from the user, you can keep an indication probably a Boolean to mark these records as picked.
Code will look something like this. Please understand that this isnt the full implementation. There can be other considerations too.
*****
recWarehouseEntry.SETRANGE("Source No.","No.");
IF recWarehouseEntry.FINDFIRST THEN
BEGIN
IF CONFIRM('Cannot delete as there are picked items. Do you wish to unpick?') THEN
BEGIN
recWarehouseEntry.Picked := TRUE;
recWarehouseEntry.MODIFY;
END;
END;
*****
Hope it helps.
André Arnaud de Cal...
292,111
Super User 2025 Season 1
Martin Dráb
230,934
Most Valuable Professional
nmaenpaa
101,156