Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>but the value of this field is 0 at the very beginning, so I have to initialize it </p> </blockquote> <p>I cant guess what exactly you are trying to do with Purchase Line, but fields like Qty. to Invoice and Qty. to Receive in most cases filled automatically when validating Quantity. Both sets equal to Quantity. Validate triggers when user enters something to field on the form or from C/AL code by calling <code>PurcaseLine.VALIDATE("Quantyity", number);</code></p> <blockquote> <p>Problem is when it goes back to 0. How can I mark that all the invoices for this line are received?</p> </blockquote> <p>When you posting an invoice posted quantity is added to the field <code>Qty. Invoiced</code> and received quantity added to field <code>Qty. Received</code>. So at any time you know how many item received and payed. <em>Both fields are readonly for user because only posting procedures can and must change those.</em></p> <p>So if you have Qty. = 10, then you post 4 of them (Qty. to Invoice = 4) and Qty. Invoiced = 0. You'll get Qty. = 10, Qty. to Invoice = 6, Qty. Invoiced = 4. Qty. to Invoice in this case is rest of the qty. to be invoiced.</p> <p>You shouldn't use any fields if you don't know their purpose. Field 'Finished' for example is part of Production Orders functionality and not related to Qty. to Invoice at all.</p> <p>To find out meaning of a field you can refer to help (press F1 while standing on a field in table). That work not for every field. Another way (if you are developer and have license) is to use Developer Tool Kit (it can be found on installation CD or <a href="http://www.mibuso.com/dlinfo.asp?FileID=1107" rel="nofollow" title="here">here</a>). This utility allows to search for dependencies between Nav objects.</p> <hr> <p>Regarding to web-services. Do not try to use those tables directly. Its really causes a lot of troubles and inconvenience. Create new operational tables. Name them <code>Purchase Order Import</code> and <code>Purchase Line Import</code>. Create pages for them and publish as web-services. Import your data into them in whatever you like format. I mean the tables can be clones of real tables or just have few fields you need. Put some code into <code>OnModify</code> trigger of the pages which will be called at the end of the import or publish codeunit with function that will create or update purchase orders and lines from Import-tables. Clear Import-tables after all.</p> <p>If your task is to partially post receipts based on quantity from external system, then your steps will be:</p> <ol> <li>assume Purchase Order and Line created, Qty is 100, you need to post this qty in portions</li> <li>import Qty to be posted via web-service to Purchase Line Import table through page</li> <li>OnModify of the page will be triggered, put some code to that trigger to update Purchase Line's <code>Qty. to Invoice</code> <strong>-or-</strong> call some codeunit via web-service and update Purchase Line's <code>Qty. to Invoice</code>. Put all business logic on creating and updating purchase line here, not in your external application.</li> <li>Now you have Qty = 100, Qty to Invoice = 5.</li> <li>Call posting codeunit via web service. Of course don't publish posting codeunit itself. Call it through another codeunit that is published.</li> <li>Now you have Qty = 100, Qty to Invoice = <em>don't really care</em>, Invoiced Qty = 5, and you can repeat steps 2-5 again.</li> </ol> <p>You shouldn't care about Qty to Invoice is thats why: next time you import next portion of qty all you need to check is Import_Qty &lt; (Qty - Invoiced Qty). If true you can post, otherwise you cant.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload