I've created a field on the purchase order line called "Fully Received Date". When a purchase Order Line is created I need to check if the Outstanding Qty is zero then set the "fully Received Date" to WORKDATE. However running through the debugger I can't isolate where I would set this condition. I'm not sure if it's custom code or standard, if it is standard and suggestions on where to be looking?
*This post is locked for comments
Check the SETSELECTIONFILTER : Link https://msdn.microsoft.com/en-us/library/dd354931(v=nav.90).aspx
Hi,
As per you requirement when oustanding qty is zero then customized field should get updated . So the above code will work as program is checking outstanding qty is zero .
Thank you! this code assumes that all the lines in the purchase order are received the same day. How can I Make it so it only affects the line selected and not all of them?
HI Lewishhh,
you can add your code in the table 39 in the function InitOutstanding
After the line
"Completely Received" := (Quantity <> 0) AND ("Outstanding Quantity" = 0);
You can add
IF "Completely Received" THEN
VALIDATE("Fully Received Date", WORKDATE);
With this solution the "Fully Received Date" will be filled in also if the user manually set on the order the field Quantity equal to the field Received Quantity
Best Regards
Is your requirement is to check the purchase order line is fully received and then update the date? If so as Amol said you can write the code on the post button. As user click the button to receive the items, system will check the each line related to PO and update the field in the PO line.
Hi,
I would suggest write a custom code on Post button like
If "Purchase Line".Outstanding Qty=0 THEN BEGIN
Your code goes here.
END;
This code will execute after user receive the material.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156