PdcPurchaseInvoices.Active: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
 
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
     objPI.Refresh
     objPI.Refresh
   else
   else

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)