PdcPurchaseInvoices.New: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 9: | Line 9: | ||
== Code example == | == Code example == | ||
The following code example creates a new purchase invoice, sets a relation, invoice no, invoice date and saves the purchase invoice. | The following code example creates a new purchase invoice, sets a relation (mandatory!), invoice no, invoice date and saves the purchase invoice. | ||
<source lang="vb"> | <source lang="vb"> | ||
Line 18: | Line 18: | ||
objPI.InvoiceNo = "12345" | objPI.InvoiceNo = "12345" | ||
objPI.InvoiceDate = Date - 2 | objPI.InvoiceDate = Date - 2 | ||
objPI.Save | if not objPI.Save then | ||
msgbox objPI.ErrorMessages | |||
end if | |||
else | else | ||
msgbox objPI.ErrorMessages | msgbox objPI.ErrorMessages |
Latest revision as of 09:32, 11 September 2014
Declaration
New as PdcPurchaseInvoiceHeader
Description
A new purchase invoice is created with this method.
Notes
After calling this method, the new created purchase invoice is immediately stored with a new number and the invoice date.
Code example
The following code example creates a new purchase invoice, sets a relation (mandatory!), invoice no, invoice date and saves the purchase invoice.
dim objPI
set objPI = Pdc.logistics.PurchaseInvoices.New
if objPI.SetRelationNo("00224") then
objPI.InvoiceNo = "12345"
objPI.InvoiceDate = Date - 2
if not objPI.Save then
msgbox objPI.ErrorMessages
end if
else
msgbox objPI.ErrorMessages
end if
Availability
Available since April 2014 (Version 4.3 onwards)