Quantity Warning on Sales Order

My customer wants a warning if the user types a order quantity that is lower than the items minimum order quantity. I put the code in table 37 field Quantity just before the Item Availibility Check. I made a confirm-message so the user becomes aware of the quantity. The problem is: If the user answers Yes and receives a stockout warning and answers Yes to that to, Quantity on SalesLine goes back to xRec.Quantity!!!??? This occurs when the user leaves the Quantity field using ENTER (still remains on the same record/line). If ARROW DOWN or ARROW UP is used, Quantity is changed accordingly. You can easily reproduce this by putting this code before the Item Availibility Check in table 37 field Quantity: IF CONFIRM(‘TEST’) THEN; Does anyone have a clue to why the behavior is like this? / Magnus Svanfeldt

Hi Magnus, could you please state your Navision version. However, I think is it not a good solution to put the warning message in the quantity trigger in the table. May be in the future you would like to import order(lines) and then you trigger the quantity and you will get the warning message (GUIALLOWED will not help you here). I suggest to put the code on the OnAfterValidate trigger on the quantity in the related form (here form46). Anyway, I right now have no clue about that behavior. Which Navision Version? Any other customisations in the table? Regards Walter

My customer is using Attain 3.01B, but I have tested this on version 3.10 and 2.60 also. My original code included a CurrFieldNo Test, so the warning only appears when the user is enetering quantity in the sales order. The strange thing is why a confirm message that does not change anything can cause this behavior.

I checked it out in 3.10. ----snip---- ELSE InitQtyToShip; //test IF CONFIRM(‘TEST’) THEN; IF (Reserve <> Reserve::Always) THEN CheckItemAvailable(FIELDNO(Quantity)); ----snip---- and it works fine; no problems at all. Are you sure you have no other modifications e.g. reserveation system?

Yes, I’m sure that I have no other modifications. The error occurs only when BOTH the confirm message and the stockout warning appears and you press ENTER when filling out the quantity field. If you use ARROW UP/DOWN after filling out quantity it works fine.

Strange. I checked again. When I have the qty of 0 in the sales line and fill in the qty with e.g. 12000, press ENTER and I confirm both warning with yes I have qty=12000. When I have qty=12000, fill in 11999, press ENTER and confirm both warnings with NO 11999 remains in the line (Message ‘the update has been interrupted…’); after pressing ESC 12000 appears (which is quite normal). The same with the arrow keys or pageUp/pageDown. Could you attach the object (Table37)? You can send me an Email if you want. Don’t forget the Navision version No. Regards Walter

I don’t seem to be able to upload any files. I couldn’t find your email-adress, please send me an email, so I can send you the object.