SQL Object
 
Syntax
 
SQL.CreateOrder(KlantNr, TextLines, Values [, ProjectRef][, OrderRef] _
         [, NoPackingList][, NoUpdateStatus])
 
Description
Generates a new order in the specified project, performing credit verification and applying debtor and/or project-specific pricing agreements. When the function completes successfully, it also executes the SQL Server stored procedure.
'sp_genereerPaklijst' is executed, which automatically adjusts the inventory.
 
Returns the newly created order number on success, otherwise 0 (zero).
 
NOTE: The stored procedure only works with the default warehouse code.
 
Parameter
Description
KlantNr
Customer code, which is also used with the Relationship Management application, alphanumeric.
TextLines
An array of type String, contains the texts for the related Code array. Normally, free texts and no item descriptions are applied here.
Values
An array of type Currency, contains all control values, related to the TextLines array.
ProjectRef
An optional parameter of type String, which contains the name of the project under which the order is to be generated. If not specified, the default name
BALIEVERKOOP' is used.
If numeric, an existing project is looked up under this project number.
OrderRef
Optional, the description to be used for the work order to be created. If not specified, the value of ProjectRef is used.
NoPackingList
 
Optional. If TRUE, no packing list is created in the database.
NoUpdateStatus
 
Optional. If TRUE, when a packing list is created, the status is not set to 5 (ready to bill). Works only in combination with NoPacklingList=FALSE.
 
See Also
Example
Sub Main()
 
    Dim MyCode(5) As Long
    Dim MyText(5) As String
    Dim MyVals(5) As Currency
    Dim MyProject As String
 
    MyText(1) = "Creditering ivm bonus"
    MyVals(1) = -127.50
    MyText(2) = "Administratiekosten"
    MyVals(2) = 8.25
    MyText(3) = "Bedankt voor uw inzet!"
    MyVals(3) = 0
 
    MyProject = InputBox$("Project?")
 
    Debug.Print SQL.CreateTextOrder("BL4998", MyText(), MyVals(), MyProject)
 
End Sub