PdcPurchaseInvoiceHeader.SetRelationNo: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Declaration ==
== Declaration ==
SetRelationNo(strRelNo) as boolean
SetRelationNo(strRelNo as string) as boolean


== Description ==
== Description ==
Line 6: Line 6:


== Notes ==
== Notes ==
The relation number is a mandatory property when creating a purchase invoice header.
The relation number is a mandatory property when creating a purchase invoice header.<br>
Relation number must exist in the relation table of PdC.
This method returns false if the relation not exists in the relation table of PdC.


== Code example ==
== Code example ==
<source lang="vb">
The following code example creates a new purchase invoice, sets a relation (mandatory!), 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.  


Line 22: Line 20:
     objPI.InvoiceDate = Date - 2
     objPI.InvoiceDate = Date - 2
     if not objPI.Save then
     if not objPI.Save then
       msgbox objPI.ErrorMessages
       msgbox pdc.LastError
     end if
     end if
   else
   else
     msgbox objPI.ErrorMessages
     msgbox pdc.LastError
   end if
   end if
</source>
</source>

Latest revision as of 11:01, 19 August 2015

Declaration

SetRelationNo(strRelNo as string) as boolean

Description

Sets the relationnumber of the purchase invoice header.

Notes

The relation number is a mandatory property when creating a purchase invoice header.
This method returns false if the relation not exists in the relation table of PdC.

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 pdc.LastError
    end if
  else
    msgbox pdc.LastError
  end if

Availability

Available since April 2014 (Version 4.3 onwards)