PdcPurchaseInvoices.Active: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:


== Description ==
== Description ==
 
The active purchase invoice is returned in an object.


== Notes ==
== Notes ==
 
After you changes some data in the invoice, you have to call refresh. After calling refresh the invoice form is updated with the object data.


== Code example ==
== Code example ==
This example changes the invoice number, invoice date and save the changes of the active/opened invoice in PdC


<source lang="vb">
<source lang="vb">
dim objInkFact
dim objPI
 
   set objInkFact = pdc.Logistics.PurchaseInvoices.Active
   set objPI = Pdc.logistics.PurchaseInvoices.Active
   if IsValid(objInkFact) then
   if IsValid(objPI) then
     msgbox "Inkoopfactuur ID (PIH_HEADER.PIH_ID) = " & objInkFact.ID
     objPI.InvoiceNo = "12345"
   end if 'IsValid(objInkFact)
    objPI.InvoiceDate = Date - 2
    if not objPI.Save then
      msgbox objPI.ErrorMessages
    end if
    objPI.Refresh
  else
    msgbox "No invoice opened in PdC."
   end if
</source>
</source>


== Availability ==
== Availability ==
Available since April 2014 (Version 4.3 onwards)

Latest revision as of 07:21, 16 April 2014

Declaration

Active as PdcPurchaseInvoiceHeader

Description

The active purchase invoice is returned in an object.

Notes

After you changes some data in the invoice, you have to call refresh. After calling refresh the invoice form is updated with the object data.

Code example

This example changes the invoice number, invoice date and save the changes of the active/opened invoice in PdC

dim objPI
 
  set objPI = Pdc.logistics.PurchaseInvoices.Active
  if IsValid(objPI) then
    objPI.InvoiceNo = "12345"
    objPI.InvoiceDate = Date - 2
    if not objPI.Save then
      msgbox objPI.ErrorMessages
    end if
    objPI.Refresh
  else
    msgbox "No invoice opened in PdC."
  end if

Availability

Available since April 2014 (Version 4.3 onwards)