Advanced Functions

NoReturn profiler:Enable(Boolean onOff)
Switches on or off (false) the profiler, recording script profiling information.

List profiler:LogScriptLines()
Returns a list of the top-most script lines that took the longest to run during the profiler session. Useful for performance optimization.

String DisassembleNode(Record node, List files)
Returns XML for the given record, putting all file data into the given list (files).

Record ReassembleNode(String xml, List files, Path path)
Reassembles the given record from XML and a list of files, for inserting into the given path (path). Doesn't insert the data, just returns it.

Boolean IsHosted()
Returns True if the server is running in a hosted environment.

String AccountName()
Returns the name of the account that the hosted server is running under.

Any table:Create(Number cols, Number rows, Number colGroups, Number headerRows, Number sideCols, Boolean sideTotal, Boolean bottomTotal)
Creates a table structure, used for managing and rendering tables of values. Specifies the number of rows in the table, column groups (colGroups, normally 1), headerRows (normally 1), side columns (normally 1, for the row title), sideTotal (true if you want an end of row total), bottomTotal (true if you want an end of table total).

NoReturn table:Set(Any table, Number col, Number row, Number colGroup, Any val, Any num)
With the table returned from table:Create, sets the data value (num) and displayed vaue (val), at the specified column (col), row (row), column group (normally 1).

Any table:Get(Any table, Number col, Number row, Number colGroup)
Retrieves the data value for the given table's column (col), row (row) and column group (colGroup, normally 1).

NoReturn table:SetTotalFormat(Any table, String format)
Sets the total cells formatting string, eg. #,#0.00 or c for currency.

NoReturn table:ExcludeRowSideTotal(Any table, Number row)
Indicates that the given row in the table should not show a total.

NoReturn table:OverrideSideTotal(Any table, Number row, String text)
Indicates that the total for the given row should be overridden with the given text.

NoReturn table:SetSide(Any table, Number col, Number row, Any val)
Sets the label (side of the row).

NoReturn table:AddTotalsRow(Any table, Number atRow)
Adds a total row at a specific row.

NoReturn table:SetHeader(Any table, Number col, Number row, Number colGroup, Any val)
Sets the header value for a given column.

String table:RenderToString(Any table)
Renders the table to HTML in a text string.

List table:RenderToSequence(Any table)
Renders the table to HTML as a list of strings, suitable for a Custom Render in a Quick Report.

List table:Render(Any table)
Renders the table to HTML as a list of strings, suitable for a Custom Render in a Quick Report.

NoReturn PrematureExit()
Commits the current transaction but then aborts the remainder of any processing.

NoReturn SetPriority(Number priorPerc)
System-level call. Sets the current thread's priority in percent. If 100% then gives it the top priority among all processes running on the system.

String InternalGetDBEngine()
Retrieves the name of the database engine used in this application.

String StackTrace()
Returns a stack trace at the current execution point.

String str:NodeToTextEx(Record node, Boolean includeDefaultValues)
Returns a textual render of the given record, optionally including default values.

String str:ToASCIIOnly(String text)
Returns an ASCII only rendering of the given string, removing any unicode characters.

Number GetMemoryUsage()
Returns the current memory usage of the process.

NoReturn Sleep(Number ms)
Makes the thread sleep for ms milliseconds.

Record Cast(Record node, Path path)
Converts the record (node) to the type at the given path.

Any GetRequestParameter(String field)
Returns the value of the given request parameter, as taken from the current URL.

String GetAgentString()
Returns the agent string sent by the user's browser.

String GetBrowserReferrer()
Returns the referrer string sent by the user's browser.

Any GetRequestParameters()
Returns a list of all the request parameters in the URL.

NoReturn ValidateScript(String script)
Validates the given script as a DbfScript. Throws an error if the script doesn't validate.

NoReturn ValidateExpression(String expression)
Validates the given expression as a DbfScript. Throws an error if the script doesn't validate.

String GetDotNetVersion()
Returns the version of .Net that is installed on the server.

Any Eval(String script, Record input, Path path)
Evaluates the given DbfScript, with input becoming #input and path becoming &path.

Boolean RunningAsSystem()
Returns true if the current script is running as admin.

NoReturn SetCookie(String uri, String name, String val)
Sets the given cookie (uri/name) to val, when the script returns a page to the user.

Any GetCookie(String uri, String name)
Retrieves the value of the cookies stored on the user's browser session.

NoReturn ClearCookies()
Clears all cookies in the browser's session related to this site.

String str:HtmlEncode(String text)
Returns the text suitable for inclusion in HTML.

String str:HtmlDecode(String text)
Returns the text HTML encoded text as regular text.

String GetMachineName()
Returns the name of the server machine.

Boolean ValidateIdentifier(String ident)
Checks that the given text is a valid identifier for use in DbfScript.

Boolean ValidateCreditCard(String cardNumber)
Validates a credit card number.

NoReturn SetCounterSeed(Path path, Number num)
Sets the counter starting number for the type at the given path. The next record inserted at that point will then use that counter number. Note: this may cause duplication errors if records already exist with that counter number. Care must be taken.

NoReturn ClearSelection()
Clears the user's selection of records, if any.

String NewGuid()
Returns a new UUID (universally-unique identifier).

String GetFormUpdatePostUrl(Path path, Path fromPath, String fromScreen)
Retrieve the URL for posting data to update data from a form. For use in custom skins.

String GetFormHtml(Path path, String returnUrl)
Retrieve the form HTML for posting data to a WorkflowFirst application. For use in custom skins.

String GetFormHtmlForAction(Path path, String actionName, Boolean isGlobal, String returnUrl)
Retrieve the form HTML for running an action in a WorkflowFirst application. For use in custom skins.

String ActionLink(Path path, String actionID, String returnURL)
Returns the URL link to run a particular action.

String ViewLink(Path path)
Returns the URL to view the data record at a given path.

String ScreenLink(Path path, String screen)
Returns the URL to view the data, and custom screen, for a given path.

String EditLink(Path path, String fromLink)
Returns the URL to edit the data record at the given path.

String CreateLink(Path path, String fromLink)
Returns the URL to create a new data record at the given path.

String ViewLinkWithHost(Path path)
Returns the URL to view the data record at a given path, including the web server host name.

Any FireEvent(Path path, String eventType, Record inputData)
Forces the raising of the given event type (Change, InlineChange) at the given path, with the given input data.

String GetCType(Any ds)
Returns the type name of the given record.

Boolean HasCTypeField(String typeName, String field)
Returns true if the given type name has the given field.

List GetCTypeFields(String typeName)
Returns a list of fields in the given type name.

List GetCTypes()
Returns a list of all the types in the system.

Path GetPathSafe(Any oval)
Gets the path of the given record or link, and returns a valid root path if the path is not set.

Any GetReturnValue()
Retrieves the last value set as the return value in the script.

String GetAppName()
Returns the application name.

String GetAppTitle()
Returns the application title.

String IPAddress()
Returns the IP address of the user.


Next Topic:
v4.2.0.956 (beta)
Up Since 2/29/2024 12:02:23 AM