Keyref: MBS-Navision 4.00 Quick Reference MBS-Navision 4.00 Quick Reference
Keyref: MBS-Navision 4.00 Quick Reference MBS-Navision 4.00 Quick Reference
Keyref: MBS-Navision 4.00 Quick Reference MBS-Navision 4.00 Quick Reference
00 Quick Reference
Page 8
KEYREF
This complex data type identifies a key in a table and the fields in this key. This gives you access to the key and the fields it
contains. The keyref object can refer to any key in any table in the database.
ACTIVE
FIELDCOUNT
FIELDINDEX
RECORD
Ok := KeyRef.ACTIVE
Use this function to find out if the key is enabled or not.
No := KeyRef.FIELDCOUNT
Use this function to return the number of fields that have been defined in a key. These functions
returns an error if no key is selected.
FieldRef := KeyRef.FIELDINDEX(Index)
Use this function to return the fieldref of the field that has this index in the key referred to by the
keyref variable.
RecordRef := KeyRef.RECORD
Use this function to return the recordref of a key. This function returns an error if no key is selected.
NUMERIC
The following numeric data types exists: BIGINTEGER, DECIMAL, INTEGER.
ABS
POWER
RANDOM
RANDOMIZE
ROUND
NewNumber := ABS(Number)
Use this function to calculate the absolute value of a number. ABS always returns a positive numeric
value or zero.
NewNumber := POWER(Number, Power)
Use this function to raise a number to a power.
Number := RANDOM(MaxNumber)
Use this function to return a pseudo-random number.
RANDOMIZE([Seed])
Use this function to generate a set of random numbers, from which RANDOM will select a random
number.
NewNumber := ROUND(Number [, Precision] [, Direction])
Use this function to round the value of a number variable. The optional parameter tells the system
how to round Number. The default rounding method is '='. There are three different options for
rounding: '=', '>', '<'
RECORD
This complex data type corresponds to a row in a table. Each record consist of fields (which form the columns of the table). A
record is typically used to hold information about a fixed number of properties.
ASCENDING
CALCFIELDS
CALCSUMS
CHANGECOMPANY
CLEARMARKS
CONSISTENT
COPY
COPYFILTER
COPYFILTERS
COUNT
COUNTAPPROX
CURRENTKEY
DELETE
DELETEALL
FIELDACTIVE
[IsAscending] :=Record.ASCENDING([SetAscending])
Use this function to change or check the order in which the system will search through a C/SIDE
table.
[Ok :=] Record.CALCFIELDS(Field1, [Field2],...)
Use this function to update the FlowFields in a record.
[Ok :=] Record.CALCSUMS(Field1, [Field2],...)
Use this function to calculate the total of a column of SumIndexFields in a C/SIDE table.
[Ok :=] Record.CHANGECOMPANY([CompanyName])
Use this function to redirect references to table data from one company to another.
Record.CLEARMARKS
Use this function to remove all marks on a record.
Record.CONSISTENT(Consistent)
Use this function to mark a C/SIDE table as being consistent or inconsistent from an administrative
point of view, which you define.
Record.COPY(FromRecord)
Use this function to copy a record from a table. All filters, marks, and keys are included in the copy.
Record.COPYFILTER(FromField, ToRecord.ToField)
Use this function to copy the filter set for one field and apply it to another field.
Record.COPYFILTERS(FromRecord)
Use this function to copy all filters set by SETFILTER or SETRANGE from one record to another.
Number := Record.COUNT
Use this function to count the number of records in a C/SIDE table.
Number := Record.COUNTAPPROX
Use this function to obtain an approximate count of the number of records in the table, for example,
for updating progress bars or displaying informational messages. The count is approximate because
it uses statistical information maintained by SQL Server, which is not kept precisely in
synchronization with modifications to the table and is not under transaction control.
CurrentKey := Record.CURRENTKEY
Use this function to return the current key of a database table.
[Ok :=] Record.DELETE([RunTrigger])
Use this function to delete a record in a C/SIDE table.
Record.DELETEALL([RunTrigger])
Use this function to delete all records in a C/SIDE table that fall within a specified range.
Ok := Record.FIELDACTIVE(Field)
Use this function to check whether a field is enabled or not.
FIELDERROR
Page 9
Record.FIELDERROR(Field, [Text])
Use this function to stop the execution of the code (cause a run-time error, in fact) and create an
error message for a field.
FIELDNAME
Name := Record.FIELDNAME(Field)
Use this function to return the name of a field as a string.
FIELDNO
Number := Record.FIELDNO(Field)
Use this function to return the number assigned to a field in the table description.
FILTERGROUP
[CurrGroup] := Record.FILTERGROUP([NewGroup])
Use this function to select a filtergroup and to find the number of the current filtergroup. A filtergroup
can contain a filter for a Record that has been set earlier with SETFILTER or SETRANGE. The total
filter applied is the combination of all the filters set in all the filtergroups. C/SIDE uses 7
FILTERGROUPS internally: 0 Std, 1 Global, 2 Form, 3 Exec, 4 Link, 5 Temp, 6 Security.
FIND
Ok := Record.FIND([Which])
Use this function to find a record in a C/SIDE table based on the values stored in keys. [Which] tells
the system how to perform the search. If SearchStr contains '=', '>' or '<', you must assign values to
all fields of the current and primary keys before you call FIND.
GET
[Ok :=] Record.GET([Value] ,...)
Use this function to find a record based on values stored in primary key fields. This function always
uses the primary key for the table and ignores any filters. The system does not change the current
key and filters after you call this function.
GETFILTER
String := Record.GETFILTER(Field)
Use this function to return a list of the filters within the current filter group that are applied to a field.
GETFILTERS
String := Record.GETFILTERS
Use this function to return a string which contains a list of the filters within the current filter group for
all fields in a record. In addition, this function also returns the state of MARKEDONLY.
GETPOSITION
String := Record.GETPOSITION([UseNames])
Use this function to return a string that contains the primary key of the current record.
GETRANGEMAX
Value := Record.GETRANGEMAX(Field)
Use this function to return the maximum value in a range for a field.
GETRANGEMIN
Value := Record.GETRANGEMIN(Field)
Use this function to return the minimum value in a range for a field.
GETVIEW
String := Record.GETVIEW([UseNames])
Use this function to return a string that describes the current sort order, key and filters on a table.
HASFILTER
Ok := Record.HASFILTER
Use this function to determine if the system has attached a filter to a record within the current filter
group.
INIT
Record.INIT
Use this function to initialize a record in a C/SIDE table. The system does not initialize primary key or
timestamp fields.
ISEMPTY
Empty := Record.ISEMPTY
Use this function to find out whether a C/SIDE table or a filtered set of records is empty. When you
are using SQL Server, this function is faster than using the Record.COUNT function and then testing
the result for zero.
INSERT
[Ok :=] Record.INSERT([RunTrigger])
Use this function to insert a record into a C/SIDE table.
LOCKTABLE
Record.LOCKTABLE([Wait] [, VersionCheck])
Use this function to lock a C/SIDE table to protect it from write transactions that conflict with each
other. The SQL Server Option for Navision only supports the default values for the parameters of the
LOCKTABLE function LOCKTABLE(TRUE,FALSE).
MARK
[IsMarked] := Record.MARK([SetMarked])
Use this function to mark a record. You can also use this function to find out if a record is marked.
MARKEDONLY
[IsMarkedOnly] := Record.MARKEDONLY([SetMarkedOnly])
Use this function to tell the system to activate a special filter. After you use this function, your view of
the table only includes records marked by this function.
MODIFY
[Ok :=] Record.MODIFY([RunTrigger])
Use this function to modify a record in a C/SIDE table.
MODIFYALL
Record.MODIFYALL(Field, NewValue [, RunTrigger])
Use this function to modify a field in all records within a range you specify.
NEXT
Steps := Record.NEXT([Steps])
Use this function to step through a specified number of records and retrieve a record. Steps is used
to define the direction of the search and how many records to step over. > 0: Search Steps records
forwards in the table. < 0: Search Steps records backwards in the table. = 0 No effect. If you do not
specify Steps, the system finds the next record.
READCONSISTENCY
Ok := Record.READCONSISTENCY
Use these functions to determine whether the table supports read consistency.
READPERMISSION
Ok := Record.READPERMISSION
Use this function to find out if you can read from a table. This function can test for both full read
permission and a partial read permission that has been granted with a security filter.
RECORDLEVELLOCKINGOk := Record.RECORDLEVELLOCKING
Use these functions to find out whether the table supports record level locking. When you are using
SQL Server, you can use record level locking. When you are using the Navision Database Server,
you cannot use record level locking.
Page 10
RELATION
TableNumber := Record.RELATION(Field)
Use this function to find out the table relationship of a given field.
RENAME
[Ok]:= Record.RENAME(Value1, [Value2],...)
Use this function to change a primary key in a C/SIDE table.
RESET
Record.RESET
Use this function to remove all filters, including any special filters set by MARKEDONLY, and change
the current key to the primary key. The system also removes any marks on the record and clears any
C/AL variables on the record.
SETCURRENTKEY
[Ok :=] Record.SETCURRENTKEY(Field1, [Field2],...)
Use this function to select a key for a table.
SETFILTER
Record.SETFILTER(Field, String, [Value],...)
Use this function to assign a filter to a field you specify.
SETPERMISSIONFILTER Record.SETPERMISSIONFILTER
Use this function to apply the user's security filter to a Record variable. The security filter is combined
with any other filters that are placed on the Record variable with SETFILTER or SETRANGE. This
C/AL function only applies to the SQL Server Option for Navision.
SETPOSITION
Record.SETPOSITION(String)
Use this function to set the fields in a primary key on a record to the values specified in the supplied
string. The remaining fields are left untouched.
SETRANGE
Record.SETRANGE(Field [,FromValue] [.ToValue])
Use this function to set a simple filter, such as a single range or a single value, on a field.
SETRECFILTER
Record.SETRECFILTER
Use this function to set the values in the current key of the current record as a record filter.
SETVIEW
Record.SETVIEW(String)
Use this function to set the current sort order, key and filters on a table.
TABLECAPTION
Caption := Record.TABLECAPTION
Use this function to return the current caption of a table as a string.
TABLENAME
Name := Record.TABLENAME
Use this function to return the name of a C/SIDE table.
TESTFIELD
Record.TESTFIELD(Field, [Value])
Use this function to test to see if the contents of a field match a given value. If the contents differ
from the given value, the system displays an error message. If you omit Value and the content of
Fields is zero or blank (empty string), the system also displays an error message.
TRANSFERFIELDS
Record.TRANSFERFIELDS(FromRecord [, InitPrimaryKeyFields])
Use this function to copy all matching fields in one record to another record. Fields are copied based
on the Field No. property of the fields.
VALIDATE
Record.VALIDATE(Field [, NewValue])
Use this function to call the triggers for the field you specify.
WRITEPERMISSION
Ok := Record.WRITEPERMISSION
Use this function to find out if you can write to a table. This function can test for both full write
permission and a partial write permission that has been granted with a security filter. A write
permission consists of Insert, Delete and Modify permissions.
RECORDID
This data type contains the table number and the primary key of a table. You can store a RecordID in the database but you
cannot set filters on a RecordID.
Form.RUN
Use this function to create and launch a form you specify. You can use CLEAR to remove the form.
RUNMODAL
[Action] := Form.RUNMODAL
Use this function to create, launch, and close the form you specify. The optional return code tells you
what action the user took. The possible return values are: OK, Cancel, LookupOK, LookupCancel,
Yes, No, Close, Helpform, RunObject, RunSystem.
SAVERECORD
CurrForm.SAVERECORD
Use this function to save the current record shown on the form.
SETRECORD
Form.SETRECORD(Record)
Use this function to select the current record shown on the form.
SETSELECTIONFILTER CurrForm.SETSELECTIONFILTER(Record)
Use this function to have the system note the records the user has selected on the form, mark those
records in the table specified, and set the filter to "marked only".
SETTABLEVIEW
SETTABLEVIEW(Record)
Use this function to apply the Table View on the current record as the table view for the form, report
or dataport.
UPDATE
CurrForm.UPDATE[(SaveRecord)]
Use this function to save the current record and then update the controls in the form. If you set the
SaveRecord parameter to FALSE, this function will not save the record before the system updates
the form.
UPDATECONTROLS
CurrForm.UPDATECONTROLS
Use this function to reload the captions of all controls on the current form. This is necessary when
the user changes the caption class of a control after the form has been loaded.
UPDATEEDITABLE
UPDATEEDITABLE(Editable)
Use this function to dynamically change the setting of the Editable property of a field, form or control.
URL
String:=Form.URL([UseNames])
This function returns a string that contains the full URL to a form.
VISIBLE
[IsVisible] := Form.VISIBLE([SetVisible])
Use this function to return the current setting of the Visible property of a form or control, and to
change the setting of the property.
WIDTH
[CurrWidth] := Form.WIDTH([NewWidth])
Use this function to return the current setting of the Width property of a form or control, and to set this
property to a new value.
XPOS
[CurrXPos] := Form.XPOS([NewXPos])
Use this function to return the current setting of the XPos property of a form or control, and to set this
property to a new value.
YPOS
[CurrYPos] := Form.YPOS([NewYPos])
Use this function to return the current setting of the YPos property of a form or control, and to set this
property to a new value.
GUID
Use this data type to give a unique identifying number to any database object. The Globally Unique Identifier (GUID) data type
is a 16 byte binary data type. This data type is used for the global identification of objects, programs, records and so on. The
important property of a GUID is that each value is globally unique. The value is generated by an algorithm, developed by
Microsoft, which assures this uniqueness. The standard textual representation is {12345678-1234-1234-1234-1234567890AB}.
CREATEGUID
GETRECORD
TABLENO
RecordRef := RecordID.GETRECORD
Use this function to return a recordref that refers to the record identified by recordID.
No := RecordID.TABLENO
Use this function to return the table number of the table identified by recordid. This function returns
an error if the record is blank.
RECORDREF
This complex data type identifies a row in a table. Each record consist of fields (which form the columns of the table). A record is
typically used to hold information about a fixed number of properties. The RecordRef object can refer to any table in the
database. Use the RecordRef.OPEN function to select the table you want to access. When you use the RecordRef.OPEN
function a new object is created. This object contains references to the open table, filters and the record itself and all the fields
it contains.
ISNULLGUID
CAPTION
CLOSE
COUNT
Guid :=CREATEGUID()
Use this function to create a new unique GUID. The value can then be assigned to a GUID data type
or a text data type. Use the text data type if you want to compare the GUID to another text string.
Ok := ISNULLGUID(Guid)
Use this function to check whether or not a value has been assigned to a GUID. A null GUID that
consists only of zeros is valid but must never be used for reference purposes.
ASCENDING
Page 7
RUN
InStream.READ
InStream.READTEXT
OutStream.WRITE
OutStream.WRITETEXT
IsEOS:= InStream.EOS()
Use this function to find out whether or not an input stream has reached End of Stream (EOS).
[{Read}:= ] InStream.Read(Variable, [Length])
Use this function to read a specified number of bytes from an InStream object. Data is read in binary
format.
[{Read}:= ] InStream.ReadText(Text, [Length])
Use this function to read text from an InStream object. READTEXT reads the specified number of
bytes, the maximum length of the string or until the end of the line. Data is read in text format.
[{Written}:= ] OutStream.Write(Variable, [Length])
Use this function to write a specified number of bytes to the stream. Data is written in binary format.
[{Written} := ] OutStream.WriteText([Text, [Length]])
Use this function to write text to an OutStream object. Data is written in text format.
QUERYREPLACE
READ
RENAME
SEEK
SETSTAMP
TEXTMODE
TRUNC
WRITE
WRITEMODE
Page 6
COUNTAPPROX
CURRENTKEY
CURRENTKEYINDEX
DELETE
DELETEALL
DUPLICATE
FIELD
FIELDCOUNT
FIELDEXIST
FIELDINDEX
FORM
Variables of this complex data type store forms. Forms contain simpler elements called controls. Controls are used to display
information to the user or to receive information from the user.
ACTIVATE
ACTIVE
CAPTION
CLOSE
EDITABLE
FORM
FORM.RUN
FORM.RUNMODAL
GETRECORD
HEIGHT
LOGHEIGHT
LOGWIDTH
LOOKUPMODE
MAXIMIZEDONOPEN
MINIMIZEDONOPEN
OBJECTID
[Ok := ] Form.ACTIVATE
Use this function to make a form or control active.
IsActive := Form.ACTIVE
Use this function to find out if the current form is active or inactive.
[CurrCaption] := Form.CAPTION([NewCaption])
Use this function to return the current caption of an object as a string, and to set a new caption for
the object.
Form.CLOSE
Use this function to close the current form.
[IsEditable] := Form.EDITABLE([SetEditable])
Use this function to return the current setting of the Editable property, and to change the setting of
the property.
Subform := Form.FORM
Use this function to access a form that is a subform of the current form - that is, the form that is
defined as the SubFormID of a subform control.
FORM.RUN(Number [, Record] [, Field])
Use this function to create and launch a form object, which you specify.
[Action] := Form.RUNMODAL(Number [, Record] [, Field])
Use this function to create, run, and close a form object, which you specify. The system runs the
form modally.
Form.GETRECORD(Record)
Use this function to retrieve the current record shown on the form.
[CurrHeight] := Form.HEIGHT([NewHeight])
Use this function to return the current setting of the Height property of a form or control, and to set
this property to a new value.
[CurrLogHeight] := Form.LOGHEIGHT([NewLogHeight])
Use this function to return the current setting of the LogHeight property of a form, and to set this
property to a new value.
[CurrLogWidth] := Form.LOGWIDTH([NewLogWidth])
Use this function to return the current setting of the LogWidth property of a form, and to set this
property to a new value.
[CurrLookupMode] := Form.LOOKUPMODE([NewLookupMode])
Use this function to return the current setting of the LookupMode property of a form, and to set this
property to a new value.
[CurrMaximized] := Form.MAXIMIZEDONOPEN([NewMaximized])
Use this function to return the current setting of the MaximizedOnOpen property of a form, and to set
this property to a new value.
[CurrMinimized] := Form.MINIMIZEDONOPEN([NewMinimized])
Use this function to return the current setting of the MinimizedOnOpen property of a form, and to set
this property to a new value.
String := Form.OBJECTID([UseNames])
This function returns a string in the "form xxx" format, where xxx is the name or number of the
application object.
FILTERGROUP
FIND
GET
GETFILTERS
GETPOSITION
GETTABLE
GETVIEW
HASFILTER
INIT
INSERT
ISEMPTY
KEYCOUNT
KEYINDEX
LOCKTABLE
MODIFY
NAME
NEXT
NUMBER
Page 11
Number := RecordRef.COUNTAPPROX
Use this function to obtain an approximate count of the number of records in the table, for example,
for updating progress bars or displaying informational messages.
CurrentKey := RecordRef.CURRENTKEY
Use this function to return the current key of the table referred to by the recordref. The current key is
returned as a string.
[CurrKeyIndex:=] RecordRef.CURRENTKEYINDEX([NewKeyIndex])
Use this function to return or set the current key of the table referred to by the recordref. The current
key is set or returned as a number.
[Ok :=] RecordRef.DELETE([RunTrigger])
Use this function to delete a record in a C/SIDE table.
RecordRef.DELETEALL([RunTrigger])
Use this function to delete all records in a C/SIDE table that fall within a specified range.
RecordRef := RecordRef.DUPLICATE
Use this function to duplicate the table that contains the recordref.
Field := RecordRef.FIELD(FieldNo)
Use this function to return the recordref of the field that has the number fieldno in the table that is
currently selected. If no field has this number, the function returns an error.
Count := RecordRef.FIELDCOUNT
Use this function to return the number of fields in the table that is currently selected or to return the
number of fields that have been defined in a key. These functions returns an error if no table or no
key is selected
Exist := RecordRef.FIELDEXIST(FieldNo)
Use this function to find out if the field that has the number fieldno exists in the table that is referred
to by the recordref. The function returns an error if no table is currently selected.
Field := RecordRef.FIELDINDEX(Index)
Use this function to return the fieldref of the field that has this index in the table referred to by the
recordref.
[CurrGroup :=] RecordRef.FILTERGROUP([NewGroup])
Use this function to change the filter group that is being applied to the table. A filtergroup can contain
a filter for a RecordRef that has been set earlier with SETFILTER or SETRANGE. The total filter
applied is the combination of all the filters set in all the filtergroups.
[Ok :]= RecordRef.FIND([Which])
Use this function to find a record in a table based on the values stored in the key fields.
[Ok:=]RecordRef.GET(RecordID)
Use this function to find a record based on the ID of the record.
String := RecordRef.GETFILTERS
Use this function to find out which filters have been applied to the table referred to by the recordref.
String := RecordRef.GETPOSITION([UseNames])
Use this functions to return a string that contains the primary key of the current record.
RecordRef.GETTABLE(rec)
Use this function to make a recordref variable use the same table instance as a record variable.
String := RecordRef.GETVIEW([UseNames])
Use this function to return a string that describes the current sort order, key and filters on a table.
Ok := RecordRef.HASFILTER
Use this function to find out whether or not a filter has been applied to the table referred to by a
recordref.
RecordRef.INIT
Use this function to initialize a record in a table.
[Ok :=] RecordRef.INSERT([RunTrigger])
Use this function to insert a record into a table.
Empty := RecordRef.ISEMPTY
Use this function to find out whether any records exist within a filtered set of records in a table.
Count := RecordRef.KEYCOUNT
Use this function to return the number of keys that exist in the table that is referred to by the
recordref. This function returns an error if no table is selected.
Key := RecordRef.KEYINDEX(Index)
Use this function to return the keyref of the key that has this index in the table that is currently
selected.
RecordRef.LOCKTABLE([Wait] [, VersionCheck])
Use this function to lock a table to protect it from write transactions that conflict with each other.
[Ok :=] RecordRef.MODIFY([RunTrigger])
Use this function to modify a record in a C/SIDE table.
Name := RecordRef.NAME
Use this function to return the name of the table that is currently selected. This function returns an
error if no table is selected.
[Steps :=] RecordRef.NEXT([Steps])
Use this function to step through a specified number of records and retrieve a record.
No := RecordRef.NUMBER
Use this function to return the table ID (number) of the table that contains the record referred to by
the recordref.
Page 12
OPEN
CLASS
FIELDERROR
GETFILTER
GETRANGEMAX
GETRANGEMIN
LENGTH
NAME
NUMBER
OPTIONCAPTION
OPTIONSTRING
RECORD
RELATION
SETFILTER
SETRANGE
TESTFIELD
TYPE
VALIDATE
REPORT
Use this complex data type to store reports. Reports contain a number of simpler elements called controls. Controls are used to
display information to the user or receive information from the user.
BREAK
BREAK
Use this function to exit from a loop or a trigger in a data item trigger of a dataport, report or XMLport.
CREATETOTALS(Var1 [, Var2] ,...)
Use this function to maintain totals for a variable in the same way as totals are maintained for fields
by using the TotalFields property.
NEWPAGE
NEWPAGE
Use this function to force a page break when printing a report.
NEWPAGEPERRECORD [IsNewPagePerRecord] := NEWPAGEPERRECORD([SetNewPagePerRecord])
Use this function to return the current setting of the NewPagePerRecord property, and to set this
property to a new value.
OBJECTID
String:=Report.OBJECTID([UseNames])
Us this function to return the name of a report.
PAGENO
[CurrPageNo] := PAGENO([NewPageNo])
Use this function to return the current page number of a report, and to set a new page number.
PAPERSOURCE
CurrReport.PAPERSOURCE(PaperBinNo [, PhysicalPage])
Use this function to return the paper source used for the current page or a specified page, and to set
a new paper source.
PREVIEW
IsPreview := PREVIEW
Use this function to determine whether a report is being printed in preview mode or not.
PRINTONLYIFDETAIL
[IsPrintOnlyIfDetail] := PRINTONLYIFDETAIL([SetPrintOnlyIfDetail])
Use this function to return the current setting of the PrintOnlyIfDetail property, and to set this property
to a new value.
QUIT
QUIT
Use this function to abort the processing of a dataport, report or XMLport.
REPORT.RUN
REPORT.RUN(Number [, ReqWindow] [, SystemPrinter] [, Record])
Use this function to load and execute the report you specify.
REPORT.RUNMODAL
REPORT.RUNMODAL(Number [, ReqWindow] [, SystemPrinter] [, Record])
Use this function to load and execute the report you specify.
RUN
Report.RUN
Use this function to load and execute the report you specify.
RUNMODAL
Report.RUNMODAL
Use this function to load and execute the report you specify.
CREATETOTALS
VALUE
Page 5
Class := FieldRef.CLASS
Use this function to return the fieldclass of the field that is currently selected.
FieldRef.FIELDERROR([Text])
Use this function to stop the execution of the code (cause a run-time error, in fact) and create an
error message for a field.
String := FieldRef.GETFILTER
Use this function to return the filter within the current filter group that are applied to a field.
Value := FieldRef.GETRANGEMAX
Use this function to return the maximum value in a range for a field.
Value := FieldRef.GETRANGEMIN
Use this function to return the minimum value in a range for a field.
Length := FieldRef.LENGTH
Use this function to return the maximum size of the field (the size specified in the DataLength
property of the field).
Name := FieldRef.NAME
Use this function to return the name of a field as a string.
No := FieldRef.NUMBER
Use this function to return the number of the field.
OptionCaption := FieldRef.OPTIONCAPTION
Use this function to return the option caption of the field that is currently selected.
OptionString := FieldRef.OPTIONSTRING
Use this function to return the list of options that are available in the field that is currently selected.
RecordRef := FieldRef.RECORD
Use this function to return the recordref of the field that is currently selected.
TableNumber := FieldRef.RELATION
Use this function to find out the table relationship of a given field.
FieldRef.SETFILTER(String [, Value],...)
Use this function to assign a filter to a field you specify.
FieldRef.SETRANGE([FromValue] [, ToValue])
Use this function to set a simple filter, such as a single range or a single value, on a field.
FieldRef.TESTFIELD([Value])
Use this function to see if the contents of a field match a given value.
Type := FieldRef.TYPE
Use this function to return the data type of the field that is currently selected.
FieldRef.VALIDATE([NewValue])
Use this function to enter a new value into a field and have the new value validated by the properties
and code that have been defined for that field.
[CurrValue :=] FieldRef.VALUE([NewValue])
Use this function to set or get the value of the field that is currently selected.
FILE
Variables of this data type give you access to files. Files can be opened in text or binary mode.
CLOSE
COPY
CREATE
CREATEINSTREAM
CREATEOUTSTREAM
CREATETEMPFILE
ERASE
EXISTS
GETSTAMP
LEN
NAME
OPEN
POS
File.CLOSE
Use this function to close a file which has been opened by OPEN.
[Ok :=] File.COPY(FromName, ToName)
Use this function to copy a file.
[Ok := ] File.CREATE(Name)
Use this function to create and open an ASCII or binary file. If the file exists, the system will truncate
it and then open it.
File.CREATEINSTREAM(Stream)
Use this function to create an InStream object for a file. This enables you to stream data into the file.
File.CREATEOUTSTREAM(Stream)
Use this function to create an OutStream object for a file. This enables you to stream data out of the
file.
File.CREATETEMPFILE
Use this function to create a temporary file. This enables you to save data of any format to a
temporary file. This file has a unique name and will be stored in the temporary files folder.
[Ok] := File.ERASE(Name)
Use this function to erase a file.
[Ok :=] File.EXISTS(Name)
Use this function to determine if a file exists.
[Ok] := File.GETSTAMP(Name, Date [, Time])
Use this function to find out the time at which a file was last written to (return a time stamp).
Length := File.LEN
Use this function to return the length of an ASCII or binary file.
Name := File.NAME
Use this function to return the name of an ASCII or binary file.
[Ok] := File.OPEN
Use this function to open an existing ASCII or binary file. As compared to CREATE, this function
does not create the file if it does not exist.
Position := File.POS
Use this function to return the current position of the file pointer in an ASCII or binary file.
CLOSINGDATE
CREATEDATETIME
CURRENTDATETIME
DATE2DMY
DATE2DWY
DATI2VARIANT
DMY2DATE
DT2DATE
DT2TIME
DWY2DATE
NORMALDATE
ROUNDDATETIME
TIME
TODAY
VARIANT2DATE
VARIANT2TIME
WORKDATE
Page 4
ClosingDate := CLOSINGDATE(Date)
Use this function to return the closing date for a Date.
DateTime := CREATEDATETIME(Date, Time)
Use this function to create a datetime from a date and a time.
Datetime := CURRENTDATETIME
Use this function to return the current datetime.
Number := DATE2DMY(Date, What)
Returns the day, month, or year based on a date.
Number := DATE2DWY(Date, What)
Returns the day of the week, week number, and year based on the input Date.
Variant := DATI2VARIANT(Date, Time)
Use this system date function to create a variant that contains a VT_DATE.
Date := DMY2DATE(Day [, Month] [, Year])
Use this function to return a Date based on a day, month, and year.
Date := DT2DATE(Datetime)
Use this function to return the date part of a datetime.
Time := DT2TIME(Datetime)
Use this function to return the time part of a datetime.
Date := DWY2DATE(WeekDay [, Week] [, Year]))
Use this function to return a Date based on a weekday, a week, and a year.
NormalDate := NORMALDATE(Date)
Use this function to return the normal date (as opposed to the closing date) for the argument Date.
NewDateTime := ROUNDDATETIME(Datetime [, Precision][, Direction])
Use this function to round a datetime.
Time := TIME
Use this function to retrieve the current time from the operating system.
Date := TODAY
Use this function to return the current date set in the operating system.
Date := VARIANT2DATE(Variant)
Use this system date function to return a date from a VT_DATE variant.
Time := VARIANT2TIME(Variant)
Use this system date function to return a time from a VT_DATE variant.
[WorkDate]:= WORKDATE([NewDate])
Use this function to return the current work date or to set a new work date.
DIALOG
Variables of this complex data type store dialog windows. These variables also give you access to a number of dialog functions,
such as OPEN, CLOSE, and so on.
BEEP
CLOSE
CONFIRM
ERROR
INPUT
MESSAGE
OPEN
STRMENU
UPDATE
YIELD
BEEP(Frequency, Duration)
Use this function to sound a tone through the computer's speaker.
Dialog.CLOSE
Use this function to close a dialog window which has been opened by OPEN.
Ok := Dialog.CONFIRM(String [, Default] [, Value1] ,...)
Use this function to create a dialog box which prompts the user for a yes or no answer.
ERROR(String [, Value1, ...])
Use this function to display an error message and end the execution of C/AL code.
NewControlID := Dialog.INPUT([ControlID] [,Variable])
Use this function to read what a user enters into a field in a window.
MESSAGE(String [, Value1, ...])
Use this function to display a text string in a message window.
Dialog.OPEN(String [, Variable1], ...)
Use this function to open a dialog window.
OptionNumber := Dialog.STRMENU(OptionString [, DefaultNumber])
Use this function to create a menu window that displays a series of options.
Dialog.UPDATE([Number] [, Value])
Use this function to update the value of a '#'-or '@' field in the current window.
YIELD
Use this function to pass control to the operating system, specifically DOS/Windows 3.x, so it can
process events. Once the operating system finishes, you regain control.
SAVEASHTML
SAVEASXML
SETTABLEVIEW
SHOWOUTPUT
SKIP
TOTALSCAUSEDBY
URL
USEREQUESTFORM
STRINGS
The following string data types exists: BIGTEXT, CODE, TEXT. The normal string functions cannot be used with a
BigText variable.
BIGTEXT
ADDTEXT
GETSUBTEXT
LENGTH
READ
TEXTPOS
WRITE
STRING
CONVERTSTR
COPYSTR
DELCHR
DELSTR
FORMAT
INCSTR
FIELDREF
This complex data type identifies a field in a table and gives you access to this field. The fieldref object can refer to any field in
any table in the database.
INSSTR
ACTIVE
MAXSTRLEN
CALCFIELD
CALCSUM
CAPTION
Ok := FieldRef.ACTIVE
Use this function to check whether the field that is currently selected is enabled or not.
[Ok :=] FieldRef.CALCFIELD
Use this function to update a FlowField in a record.
[Ok:=] FieldRef.CALCSUM
Use this function to calculate the total of a SumIndexField in a table.
Caption := FieldRef.CAPTION
Use this function to return the current caption of a field referred to by a fieldref as a string.
Page 13
LOWERCASE
PADSTR
SELECTSTR
BigText.ADDTEXT(Variable [,Position])
Use this function to add a text string to a BigText variable. The string can be inserted anywhere in
the Variable or added at the end of the variable.
[RetLength] := BigText.GETSUBTEXT(Variable, Position [,Length])
Use this function to retrieve part of a BigText variable.
Length := BigText.LENGTH
Use this function to retrieve the length of a BigText variable.
[Ok := ] BigText.READ(InStream)
Use this function to stream a BigText that is stored as a BLOB in a table to a BigText variable.
Position := BigText.TEXTPOS(String)
Use this function to retrieve the position at which a specific string first occurs in a BigText.
[Ok := ] BigText.WRITE(OutStream)
Use this function to stream a BigText to a BLOB field in a table.
NewString := CONVERTSTR(String, FromCharacters, ToCharacters)
Use this function to convert the characters in a string based on the characters in the strings
FromCharacters and ToCharacters, which serve as conversion tables.
NewString := COPYSTR(String, Position [, Length])
Use this function to copy a substring of any length from a specific position in a string (text or code) to
a new string. If you omit Length, the resulting string includes all characters from Position to the end
of the string.
NewString := DELCHR(String [, Where] [, Which])
Use this function to delete one or more characters in a string.
NewString := DELSTR(String, Position [, Length])
Use this function to delete a substring inside a string (text or code).
String := FORMAT(Value [, Length] [, FormatStr/Number])
Use this function to format a value into a string.
NewString := INCSTR(String)
Use this function to increase a positive number or decrease a negative number inside a string by one
(1).
NewString := INSSTR(String, SubString, Position)
Use this function to insert a substring into a string.
NewString := LOWERCASE(String)
Use this function to convert all letters in a string to lowercase.
MaxLength := MAXSTRLEN(String)
Use this function to return the maximum defined length of a string variable.
NewString := PADSTR(String, Length [, FillCharacter])
Use this function to change the length of a string to a length you define. The system does this by
either truncating the string or adding filler characters at the end of the string.
NewString := SELECTSTR(Number, CommaString)
Use this function to retrieve a substring from a comma-separated string.
STRCHECKSUM
STRLEN
STRPOS
STRSUBSTNO
UPPERCASE
SYSTEM
ARRAY
ARRAYLEN
COMPRESSARRAY
COPYARRAY
Page 14
VISIBLE
WIDTH
XPOS
YPOS
DATABASE
Length := ARRAYLEN(Array [, Dimension])
Use this function to return the total number of elements in an array or the number of elements in a
specific dimension.
[Count =:] COMPRESSARRAY(StringArray)
Use this function to move all non-empty strings (text) in an array to the beginning of the array. The
resulting StringArray has the same number of elements as the input array, but empty entries and
entries that contain only blanks appear at the end of the array.
COPYARRAY(NewArray, Array, Position [, Length])
Use this function to copy one or more elements in an array to a new array. You can only copy from
one-dimensional arrays. Repeat the COPYARRAY function to copy two- and three-dimensional
arrays.
CHECKLICENSEFILE
COMMIT
COMPANYNAME
CURRENTTRANSACTIONTYPE
SELECTLATESTVERSION
CODECOVERAGE
CODECOVERAGELOG
[IsActive]:=CODECOVERAGELOG([NewIsActive])
Use this function to start and stop the logging of code. You can also use it to retrieve the current
logging status. You must only start the Code Coverage tool from the command prompt when you
want to get a total overview of the code used when running Navision or when you are testing the
application. To start Navision with the Code Coverage tool on, enter the following command:
fin.exe COVERAGELOG
SERIALNUMBER
TRANSACTIONTYPE
USERID
LANGUAGE
GLOBALLANGUAGE
LANGUAGE
WINDOWSLANGUAGE
OPERATING SYSTEM
COMMANDLINE
CONTEXTURL
ENVIRON
GUIALLOWED
HYPERLINK
OSVERSION
SHELL
Page 3
[IsVisible] := Form.VISIBLE([SetVisible])
Use this function to return the current setting of the Visible property of a form or control, and to
change the setting of the property.
[CurrWidth] := Form.WIDTH([NewWidth])
Use this function to return the current setting of the Width property of a form or control, and to set this
property to a new value.
[CurrXPos] := Form.XPOS([NewXPos])
Use this function to return the current setting of the XPos property of a form or control, and to set this
property to a new value.
[CurrYPos] := Form.YPOS([NewYPos])
Use this function to return the current setting of the YPos property of a form or control, and to set this
property to a new value.
[LanguageID]:=GLOBALLANGUAGE([NewLanguageID])
Use this function to set and retrieve the current C/SIDE global language setting The LanguageID is a
standard Windows language ID. The Windows Language virtual table contains a list of these IDs and
the corresponding names and short names..
[CurrLanguage]:= LANGUAGE([NewLanguage])
Use this function to set and retrieve the current language setting for an object (form, report or
dataport).
LanguageID:= WINDOWSLANGUAGE
Use this function to retrieve the current Windows language setting.
String := COMMANDLINE
Use this function to return a list of the parameters used to start Navision.
String:=CONTEXTURL
Use this function to return a context string that defines the current position of the running objects.
Here are two examples of a context string:
navision://client/run?database=filename&company=companyname
navision://client/run?server=servername&company=companyname&servertype=MSSQL
String := ENVIRON(Name)
Use this function to return a string associated with an environment variable. If the environment
variable does not exist, the string that is returned may contain garbage.
[Ok:=] GUIALLOWED()
Use this operating system function to check whether the C/AL code is allowed to show any
information on the screen. When you run Navision Application Server, GUIALLOWED always returns
FALSE and any call to CONFIRM or dialog.OPEN, or any attempt to use a form or dataport will
generate an error.
HYPERLINK(URL)
This function starts up Microsoft Internet Explorer, passing a URL as an argument to that program.
String := OSVERSION
Use this function to return a string which contains the name and version of the operating system or
operating environment. This string tells you the type and version of the operating system or operating
environment. Here are some typical examples of what the system returns: Windows 98 ->
Windows_95_4.10; Windows NT -> Windows_NT_4.0; Windows 2000 -> Windows_NT_5.0;
Windows XP -> Windows_NT_5.1; Windows 2003 -> Windows_NT_5.2.
[ReturnCode]:= SHELL(Name [, Param, ...])
Use this function to execute external programs and operating system commands from C/AL
programs. You can run this function modally or non-modally, depending on whether or not you
include the return value from the external program in your code. To pass multiple parameters to the
CHECKLICENSEFILE(KeyNumber)
Use this function to check a key in the license file of the system.
COMMIT
Use this function to end the current write transaction.
Name := COMPANYNAME
Use this function to return the current company name.
[TransactionType :=]CURRENTTRANSACTIONTYPE([TransactionType])
This function can be used both to return the current transaction type and set a new type to
be assigned. The following basic transaction types are available: Browse, Snapshot,
UpdateNoLocks, Update, Report. [SQL]
SELECTLATESTVERSION
This function forces the latest version of the database to be used.
String := SERIALNUMBER
Use this function to return a string which contains the serial number of the license file for
your Navision system.
Use variables of this complex data type to store the current transaction type. You can then
use the value to set the transaction type. You can only change the transaction type when
there is no current transaction, in other words immediately after a commit.
ID := USERID
Use this function to have the system return the ID of the current user.
DATAPORT
Dataports are objects that are used for importing data from and exporting data to external text files.
BREAK
BREAK
Use this function to exit from a loop or a trigger in a data item trigger of a dataport, report or XMLport.
DATAPORT.RUN(Number [, ReqWindow] [, Record])
Use this function to load and execute the dataport you specify.
DATAPORT.RUNMODAL DATAPORT.RUNMODAL(Number [, ReqWindow] [, Record])
Use this function to load and execute the dataport you specify.
FILENAME
[CurrFileName] := FILENAME([NewFileName])
Use this function to return the current setting of the FileName property of a dataport, and to set this
property to a new value.
IMPORT
[IsImport] := IMPORT([SetImport])
Use this function to return the current setting of the Import property, and to change the setting of the
property.
QUIT
QUIT
Use this function to abort the processing of a dataport, report or XMLport.
RUN
Dataport.RUN
Use this function to load and execute the dataport you specify.
RUNMODAL
Dataport.RUNMODAL
Use this function to load and execute the dataport you specify.
SETTABLEVIEW
SETTABLEVIEW(Record)
Use this function to apply the Table View on the current record as the table view for the form, report
or dataport.
SKIP
SKIP
Use this function to skip the current iteration of the current dataport, report or XMLport.
DATAPORT.RUN
Page 2
AUTOMATION
The Automation data type is used to reference an automation server. In order to use an automation server in C/SIDE, define a
variable of type Automation and give it a name. C/SIDE can receive events from an Automation server.
CREATE
ISCLEAR
VARIABLEACTIVE
BLOB
The maximum size of a BLOB is normally determined by your system's disk storage capacity. However, the maximum size in
C/SIDE is 2GB.
CREATEINSTREAM
CREATEOUTSTREAM
EXPORT
HASVALUE
Blob.CreateInStream(Stream)
Use this function to create an InStream object for a BLOB (Binary Large Object).
This enables you to stream data into the BLOB.
Blob.CreateOutStream(Stream)
Use this function to create an OutStream object for a BLOB (Binary Large Object).
This enables you to stream data out of the BLOB.
[ExportName :=] Blob.EXPORT([Name [, CommonDialog]])
Use this function to export a BLOB (Binary Large Object).
HasValue := Blob.HASVALUE
Use this function to determine if a BLOB (Binary Large Object) has a value.
[ImportName :=] Blob.IMPORT([Name [, CommonDialog]])
Use this function to import a BLOB (Binary Large Object).
SLEEP
VARIABLE
CLEAR
CLEARALL
COPYSTREAM
EVALUATE
Page 15
command, enter the parameters, either as individual arguments or as a string with the arguments
separated by spaces. The total length of the strings cannot exceed 128 characters.
SLEEP(Duration)
Use this function to return control to the operating system for a specifiable amount of time
(milliseconds).
CLEAR(Variable)
Use this function to clear the value of a single variable. CLEAR also clears all filters that were set if
the variable is a record and resets the key to the primary key. Use the CLEARALL function to clear
all internal variables, keys, and filters in the object and in any associated objects such as reports,
forms, codeunits, and so on that contain C/AL code. Note, however, that CLEARALL does not affect
or change values for variables in single instance codeunits.
CLEARALL
Use this function to clear all internal variables (except REC variables), keys, and filters in the object
and in any associated objects, such as reports, forms, codeunits, and so on that contain C/AL code.
CLEARALL works by calling CLEAR repeatedly on each variable. However, this is not the case with
codeunits, where the CLEARALL function works by calling CLEARALL inside the codeunit. It deletes
the contents of the codeunit, whereas CLEAR only deletes the reference to the codeunit.
[Ok :=] COPYSTREAM(OutStream, InStream)
Use this variable function to copy the information contained in an InStream to an OutStream.
[Ok :=] EVALUATE(Variable, String [, Number])
Use this function to evaluate a string representation of a value into its normal representation. The
system assigns the result to a variable.
CODEUNIT
Use this complex data type to store units of C/AL code. Codeunits contain a number of user-defined functions.
VARIANT
The C/AL variant data type can contain any variants from OCX and Automation objects (VT_VARIANT). The variant data type
can contain the following C/AL data types: record, file, action, codeunit, Automation, boolean, option, integer, decimal, char,
text, code, date, time, binary, DateFormula, TransactionType, InStream and OutStream. To return C/AL variants in function
calls, you must pass them in a parameter ByVar (called ByRef in COM).
Codeunit.RUN
DATI2VARIANT
IMPORT
RUN
CONTROLS
ACTIVATE
DECIMALPLACESMAX
DECIMALPLACESMIN
EDITABLE
ENABLED
HEIGHT
INLINEEDITING
UPDATEEDITABLE
UPDATESELECTED
UPDATEFONTBOLD
UPDATEFORECOLOR
UPDATEINDENT
ISACTION
ISAUTOMATION
ISBINARY
ISBOOLEAN
[Ok := ] Form.ACTIVATE
Use this function to make a form or control active.
[CurrMaxDecimals] :=DECIMALPLACESMAX([NewMaxDecimals])
Use this function to return the current setting of the maximum number of decimal places for a control
(field or text box), and to set a new value.
[CurrMinDecimals]:=DECIMALPLACESMIN([NewMinDecimals])
Use this function to return the current setting of the minimum number of decimal places for a control
(field or text box), and to set a new value.
[IsEditable] := Form.EDITABLE([SetEditable])
Use this function to return the current setting of the Editable property, and to change the setting of
the property.
[IsEnabled] := ENABLED([SetEnabled])
Use this function to return the current setting of the Enabled property of a control, and to change the
setting of the property.
[CurrHeight] := Form.HEIGHT([NewHeight])
Use this function to return the current setting of the Height property of a form or control, and to set
this property to a new value.
[IsInLineEditing] :=INLINEEDITING([SetInLineEditing])
Use this function to return the current setting of the InLineEditing property of a table box or a matrix
box, and to change the setting of the property.
UPDATEEDITABLE(Editable)
Use this function to dynamically change the setting of the Editable property of a field, form or control.
UPDATESELECTED(Selected)
Use this function to mark a control as selected (which will normally be displayed in reverse video, but
this depends upon the Windows color scheme that the end user has chosen.)
UPDATEFONTBOLD(FontBold)
Use this function to dynamically change the setting of the FontBold property of a control.
UPDATEFORECOLOR(ForeColor)
Use this function to dynamically change the setting of the ForeColor property of a control.
UPDATEINDENT(Indent)
Use this function set the Indent property of a text box.
ISCHAR
ISCODE
ISCODEUNIT
ISDATE
ISDATEFORMULA
ISDECIMAL
ISFILE
ISINSTREAM
ISINTEGER
ISOPTION
ISOUTSTREAM
ISRECORD
ISTEXT
ISTIME
ISTRANSACTIONTYPE
VARIANT2DATE
VARIANT2TIME
Page 16
Time := VARIANT2TIME(Variant)
Use this system date function to return a time from a VT_DATE variant.
XMLPORT
The XMLport object is conceptually related to a dataport; you also use XMLports to import and export data, but in XML format.
XMLports make the process of exchanging data in XML between systems more simple and streamlined. You only need a basic
knowledge of XML and you do not have to create XML documents using external products.
BREAK
QUIT
SKIP
XMLport.EXPORT
XMLport.IMPORT
BREAK
Use this function to exit from a loop or a trigger in a data item trigger of a dataport, report or XMLport.
QUIT
Use this function to abort the processing of a dataport, report or XMLport.
SKIP
Use this function to skip the current iteration of the current dataport, report or XMLport.
[{Ok} :=] EXPORT(Number, OutStream[, Record])
Use this function to create an XML data stream (XML document) and send it to a chosen destination.
[{Ok} :=] IMPORT(Number, InStream [, ResponseOutStream])
Use this function to read and parse an incoming XML data stream (XML document).
Quick Reference
GENERAL INFO
Virtual Tables
2000000001
2000000002
2000000003
2000000004
2000000005
2000000006
2000000007
2000000009
2000000010
2000000020
2000000022
2000000024
2000000026
2000000028
2000000029
2000000037
2000000038
2000000039
2000000040
Object
User
Member Of
User Role
Permission
Company
Date
Session
Database File
Drive
File
Monitor
Integer
Table Information
System Object
Performance
AllObj
Printer
License Information
2000000041
2000000042
2000000043
2000000044
2000000045
2000000046
2000000049
2000000050
2000000051
2000000052
2000000053
2000000054
2000000055
2000000056
2000000058
2000000059
2000000061
2000000203
Field
OLE Control
License Permission
Permission Range
Windows Language
Automation Servers
Code Coverage
Windows Object
Navision Attain DB Srv
Windows Group Member
Windows Access Control
Windows Login
SID - Account ID
User SID
AllObjWithCaption
Breakpoints
User Menu Level
Database Key Groups
Caption Classes
When you have set the CaptionClass property on a field or control, users can configure the caption of the field or control without
having to modify code. C/SIDE passes the value of the CaptionClass property to the trigger with ID 15 on Codeunit 1, which
translates the caption class to a caption that users can see.
C/SIDE calls this trigger with a language and a caption class. The trigger must convert the caption class into the specific caption
for that language and return it as a string. Language is specified as an integer. Caption class is a text.
Data Types
ACTION
AUTOMATION
BIGINTEGER
BIGTEXT
BINARY
BLOB
BOOLEAN
CHAR
CODE
CODEUNIT
DATAPORT
DATE
DATEFORMULA
DATETIME
DECIMAL
DIALOG
DURATION
FIELDREF
FILE
FORM
GUID
INSTREAM
INTEGER
KEYREF
OCX
OPTION
OUTSTREAM
RECORD
RECORDID
RECORDREF
REPORT
TABLEFILTER
TEXT
TIME
TRANSACTIONTYPE
VARIANT
XMLPORT
Table of contents:
AUTOMATION
BLOB
CODEUNIT
CONTROLS
DATABASE
DATAPORT
DATES & TIMES
DIALOG
FIELDREF
FILE
FORM
GUID
2
2
2
2
3
3
3
4
4
5
6
7
7
8
8
8
10
10
12
13
14
15
16
16