# Sales Orders

**URL:** <https://www.dynamicsuser.net/t/sales-orders/4544>\
**Category:** Developers Forum\
**Created:** [July 26, 2000, 2:56pm UTC](https://www.dynamicsuser.net/t/sales-orders/4544 "2000-07-26T14:56:09Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![FormerMember](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@FormerMember](https://www.dynamicsuser.net/u/FormerMember)\
**Post date:** [July 26, 2000, 2:56pm UTC](https://www.dynamicsuser.net/t/sales-orders/4544/1 "2000-07-26T14:56:09Z")

</div>

Can someone tell me what triggers need to be modified in the Purchase Order so that the Quantity to Receive & Quantity to Invoice fields always default to zero? Thanks! Diana Burton Beck Consulting, Inc. Edited by - Diana on 7/26/00 3:57:04 PM

---

<div class="post-metadata">

**Author:** ![Anonymous1](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Anonymous1](https://www.dynamicsuser.net/u/Anonymous1)\
**Post date:** [July 26, 2000, 3:25pm UTC](https://www.dynamicsuser.net/t/sales-orders/4544/2 "2000-07-26T15:25:58Z")

</div>

In the Purchase Line table, change the functions InitQtyToReceive and InitQtyToInvoice to set the respective fields to 0.

---

<div class="post-metadata">

**Author:** ![FormerMember](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@FormerMember](https://www.dynamicsuser.net/u/FormerMember)\
**Post date:** [July 26, 2000, 4:58pm UTC](https://www.dynamicsuser.net/t/sales-orders/4544/3 "2000-07-26T16:58:59Z")

</div>

I included a statement in both the InitQtytoReceive & InitQtytoInvoice triggers setting the fields to zero. Indeed when I create a new PO, both fields have a blank(zero) value, however, when I try to enter a quantity to receive as soon as I leave the field, it defaults back to zero. What else do I have to do to make this work. It seems like it should be so simple. Thanks again for your help! Diana Burton Beck Consulting, Inc.

---

<div class="post-metadata">

**Author:** ![Roelof](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@Roelof](https://www.dynamicsuser.net/u/Roelof)\
**Post date:** [July 26, 2000, 5:22pm UTC](https://www.dynamicsuser.net/t/sales-orders/4544/4 "2000-07-26T17:22:47Z")

</div>

Diana, You have to check all the validate calls in the quantity trigger, quantity to ship trigger and the quantity to invoice trigger. That is the best way to find out where the fields are being set to zero again. Roelof.

---

<div class="post-metadata">

**Author:** ![David\_Cox](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@David\_Cox](https://www.dynamicsuser.net/u/David_Cox)\
**Post date:** [July 26, 2000, 11:26pm UTC](https://www.dynamicsuser.net/t/sales-orders/4544/5 "2000-07-26T23:26:02Z")

</div>

Diana In you InitQtyToReceive & Invoice Is there a new or existing field you can test for a Value IE: PurchHeader.GET(“Document Type”,“Document No.”); IF (PurchHeader.“On Hold” \<\> ‘’)OR (NOT PurchHeader.“Goods Received”) THEN BEGIN // Clear Values “Quantity to Receive”:=0; “Qty. to Receive (Base)”:=0; EXIT; END; Mr David Cox MindSource (UK) Limited Navision Solutions Partner Email: [david@mindsource.co.uk](mailto:david@mindsource.co.uk) Web: [www.mindsource.co.uk](http://www.mindsource.co.uk)

---

<div class="post-metadata">

**Author:** ![Jack\_Reynolds](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@Jack\_Reynolds](https://www.dynamicsuser.net/u/Jack_Reynolds)\
**Post date:** [July 27, 2000, 1:06pm UTC](https://www.dynamicsuser.net/t/sales-orders/4544/6 "2000-07-27T13:06:13Z")

</div>

Try removing the call to InitQtyToReceive in the OnValidate trigger of “Purchase Line”.Quantity.

---

<div class="post-metadata">

**Author:** ![David\_Cox](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@David\_Cox](https://www.dynamicsuser.net/u/David_Cox)\
**Post date:** [July 28, 2000, 7:33am UTC](https://www.dynamicsuser.net/t/sales-orders/4544/7 "2000-07-28T07:33:04Z")

</div>

The InitQtyToReceive populates the Qty. to Receive (Base) which is the Quantity that is Received to the Item Ledgers. Removing the call to InitQtyToReceive would result in Zero Quantity being received to the Ledgers, even if the Qty. to Receive has a Value. Rememer the purchase Line is for Multi Documents Quote,Order,Credit Memo,Blanket Order and the Qty. to receive is only on the Order Sub Form. Jack Reynolds Wrote: Try removing the call to InitQtyToReceive in the OnValidate trigger of “Purchase Line”.Quantity. Mr David Cox MindSource (UK) Limited Navision Solutions Partner Email: [david@mindsource.co.uk](mailto:david@mindsource.co.uk) Web: [www.mindsource.co.uk](http://www.mindsource.co.uk) Edited by - David Cox on 7/28/00 12:05:53 PM

---

<div class="post-metadata">

**Author:** ![Jack\_Reynolds](https://avatars.discourse-cdn.com/v4/letter/j/ba9def/32.png) [@Jack\_Reynolds](https://www.dynamicsuser.net/u/Jack_Reynolds)\
**Post date:** [July 28, 2000, 1:10pm UTC](https://www.dynamicsuser.net/t/sales-orders/4544/8 "2000-07-28T13:10:12Z")

</div>

Removing the call to InitQtyToReceive will keep the Qty. to Receive field from defaulting to the Outstanding Quantity when changes are made to the Quantity. The user can always enter the desired quantity to receive directly into the Qty. to Receive field. The call to InitQtyToReceive can, of course, be made conditional based on the value of the Document Type field.

---

<div class="post-metadata">

**Author:** ![FormerMember](https://avatars.discourse-cdn.com/v4/letter/f/74df32/32.png) [@FormerMember](https://www.dynamicsuser.net/u/FormerMember)\
**Post date:** [July 28, 2000, 5:42pm UTC](https://www.dynamicsuser.net/t/sales-orders/4544/9 "2000-07-28T17:42:33Z")

</div>

Thanks for all the information guys. I’ve tried removing the call to InitQty to Receive in the OnValidate trigger of “Purchase Line”.Quantity… 1. On a new Purchase Order, it now defaults the Qty to Receive & Invoice to Zero, but if you receive a partial quantity, the Qty to Receive & Invoice are then filled with the Remaining quantity to Receive/Invoice. 2. On a Purchase Invoice, it is also setting the Qty to Receive & Qty to Invoice to zero. Normally the user doesn’t see these fields on a Purchase Invoice, so does this mean they will have to handle the INvoice the same as a PO with Qty to Receive & Qty to Invoice? 3. Is there a way to have the Purchase Invoice use the normal code but a PO use the modified code??? Diana Burton Beck Consulting, Inc.

---

<div class="post-metadata">

**Author:** ![cbradney](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@cbradney](https://www.dynamicsuser.net/u/cbradney)\
**Post date:** [July 31, 2000, 8:06am UTC](https://www.dynamicsuser.net/t/sales-orders/4544/10 "2000-07-31T08:06:42Z")

</div>

To check the document type just go if “Document Type”\<\>“Document Type”::Invoice then begin //set the fields you want to 0/make the call to a function here. end; Craig Bradney Project Manager - Technical Navision Solutions & Services Deloitte Growth Solutions Deloitte Touche Tohmatsu P:+61-2-9322-7796 F:+61-2-9322-7502 E:craig\_bradney@deloitte.com.au
