Invoice_Cancelled
Invoice_Cancelled = 3
Example
procedure ScriptEvent(var Value: variant);
var
InvoiceStatusNum: Integer;
begin
InvoiceStatusNum := Invoice_Cancelled;
Value := GetInvoiceStatusCode(InvoiceStatusNum); // 'Cancelled'
end;
Usage
Invoice_Cancelled identifies the Cancelled invoice lifecycle state as Invoice_Status.Num value 3 for Velox scripts and status-event configuration.
Value
| Property | Value |
|---|---|
| Script type | LongInt |
| Numeric value | 3 |
| Canonical text | Cancelled through Invoice_Cancelled_String |
| Database domain | Invoice_Status.Num and Invoice_Hdr.StatusNum |
Additional Technical Info
Invoice_Cancelled is the script-visible LongInt identifier for the Cancelled invoice lifecycle state. Its fixed value is 3. Use it with invoice StatusNum values, the invoice-status conversion functions and invoice status-event configuration.
The constant identifies a state; reading it does not change an invoice, write a database value or dispatch an event.
Implementation
Velox declares the native constant as 3 and registers the same LongInt value with PascalScript. GetInvoiceStatusCode maps it to Cancelled; GetInvoiceStatusNum performs the reverse mapping. The numeric name is also registered in the Velox constant tag map, so a configuration tag such as <!Invoice_Cancelled!> expands to 3.
A fresh VxData database seeds Invoice_Status row 3 with description Cancelled. Invoice_Hdr.StatusNum has a foreign key to that table, and Invoice_Event_Type.StatusNum uses the same lifecycle domain when selecting event configuration.
Behaviour
Use Invoice_Cancelled for equality checks and assignments in fields that explicitly use the invoice lifecycle-status domain. GetInvoiceStatusCode returns Cancelled for this value. GetInvoiceStatusNum recognises that token case-insensitively; it does not trim surrounding whitespace.
The state may participate in configured send and notification event selection through Invoice_Event_Type, but the constant neither proves that an event configuration exists nor causes any transition or event by itself.
Edge cases and quirks
- Do not confuse
Invoice_Hdr.StatusNumwithInvoice_Hdr.Status.StatusNumuses the three-value invoice lifecycle domain;Statususes the separate general issue/presentation status scale. - Numeric values are not type-safe in PascalScript. The same integer can appear in other status or type families, so use the identifier belonging to the field's documented domain.
Invoice_Statusstores the text inDescription; unlikeInvoice_Type, it has no separateCodecolumn.- The reverse converter returns
Nullfor an unknown number. It does not coerce an out-of-range value into a lifecycle state.
Side effects
Reading Invoice_Cancelled, expanding its numeric tag or comparing it has no I/O or state-changing side effect. Persisting a value or running an invoice flow is behaviour of the calling script or module, not the constant.
Errors
Reading the constant does not raise an error. A wrong numeric domain can select incorrect business or event logic, and database persistence outside the valid Invoice_Status keys can fail the relevant foreign-key constraint.
Performance and concurrency
This is an immutable compiled value. Access and comparison are constant-time, allocate no persistent resource and carry no shared mutable state.
Remarks
The example is source-reviewed and non-destructive. It demonstrates the supported numeric-to-code mapping without reading or updating a live invoice.
Related entries
Invoice_Cancelled_Stringis the paired canonical text.GetInvoiceStatusCodemaps supported numbers to text.GetInvoiceStatusNummaps recognised text to a number.