I was thinking about this when I read another post about updating a PO Qty when you updates a sales line qty.
http://www.mibuso.com/forum/viewtopic.php?t=17518
I want to do the reverse.
We receive orders and the merch is not currently instock.
I altered the Req worksheet to pull just the OUT items and create a po for them.
Now when the PO is received I manually drill into each po line to it's corresponding Sales order and manually update the quanity. (yes one at a time)
I would like to have a Command Button On the PO header "Update Sales Lines". Each Po line does have a "Special Order Sales No" & "Special Order Sales line No" filled in.
On push of the button or function It should update the sales line with the po's "Qty received" for it's matching line. (or quanitity)
I tried some code but I seem to be off base.
IF NOT DIALOG.CONFIRM(Question,TRUE)
THEN EXIT
ELSE
Salesline.LOCKTABLE;
Salesline.RESET;
Salesline.SETRANGE(Salesline."Document Type",Purchline."Document Type");
Salesline.SETRANGE(Salesline."Document No.",Purchline."Special Order Sales No.");
Salesline.SETRANGE(Salesline."Line No.",Purchline."Special Order Sales Line No.");
IF Salesline.FIND('-') THEN
REPEAT
IF Salesline."Special Order Purchase No." <> '' THEN
Salesline.Quantity := Purchline.Quantity;
Salesline.MODIFY(TRUE);
UNTIL Salesline.NEXT = 0;
Any suggestions welcome.
Comments
I'm currently testing
Puchase Line is the dataitem..
It appears to be geting the correct sales line but it's not updating.
What am I doing wrong?
http://www.BiloBeauty.com
http://www.autismspeaks.org
I added Sales Line as a dataitem (indented) linked with code below to Purchase Line.
and added in the sales line dataitem
So I can still choose the PO# using the Purchase Line table and it updates all the orders (multiple) that have sales lines linked.
Add a command button to the purch header "Update Special Order Lines" & Happy Time!
http://www.BiloBeauty.com
http://www.autismspeaks.org
By adding
Salesheader.GET("Document Type",Salesline."Document No.");
.
**Do sales Header Stuff too if needed**
.
Salesheader.MODIFY;
Believe it or not this whole update thing will save us tons of man hours. \:D/
http://www.BiloBeauty.com
http://www.autismspeaks.org