Skip to content

Commands, calls, messages, and navigation

Client keyword reference / Commands, calls, messages, and navigation

IFS Cloud 26R1 · Documentation-based examples · Not compiled or executed in IFS.

First decide whether the operation applies to one selected record, several records, or the whole page. Supply and authorize every action/function in the projection before adding a button. The fictional CheckRequest function below returns Text and does not change business data.

  1. Expose CheckRequest(RequestId) returning a text result and test it through your approved API tool.
  2. Define this command at file scope. Insert command CheckTrainingRequest; in the request list or group.
  3. Select one record, execute, and compare the returned result with the server response.
  4. Test no selection, a null ID, and a denied user. A disabled button is not permission enforcement.
command CheckTrainingRequest for DemoRequest {
label = "Check request";
mode = SingleRecord;
enabled = [RequestId != null];
variable Result Text;
execute {
if [RequestId = null] { exit; }
set Result = "Awaiting check";
call CheckRequest(RequestId) into Result;
info("Check result: ${Result}");
}
}

variable is command-local; an entity attribute has a different lifetime. into receives the method result. set changes a client value and is not an implicit commit. Global commands do not automatically have a selected record; avoid using row attributes in that mode without an explicit data source.

Use a confirmation before a deliberate mutation; call the actual action only in the accepted branch. Define CloseTrainingRequest(RequestId) separately with permission, state, and concurrency checks.

execute {
confirm("Close this training request?") {
when OK {
call CloseTrainingRequest(RequestId);
success("The close operation completed.");
}
when CANCEL { exit; }
}
}

inquire("Continue?") { when YES { info("Continue selected"); } when NO { exit; } when CANCEL { exit; } } gives three outcomes. messagebox("Review", question, "Choose a review path") { when "Inspect" { info("Inspect selected"); } when "Cancel" { exit; } } supplies named buttons. Put either inside an execute block, not at file scope.

Use alert("Review the request before proceeding."); for acknowledgment; info, success, warning, and error for their corresponding notifications. An error toast is not a substitute for a rejected server transaction. Exercise Cancel and a failed call: neither should show a success message or change the row. If using log("Training check started");, omit personal data, tokens, and entire payloads.

The destination must exist and accept the chosen keys. For the page defined in the scaffold, this command navigates using a typed OData substitution:

command OpenTrainingRequest for DemoRequest {
label = "Open request";
mode = SingleRecord;
execute {
navigate "page/DemoRequest/RequestDetails?$filter=RequestId eq $[RequestId]";
}
}

$[RequestId] formats a value for this navigation filter. Do not manually quote ${RequestId} as if every key were harmless plain text. Test a key containing an apostrophe and a multi-part key. For composite identity, include every required key. A list insertion can use details = "page/DemoRequest/RequestDetails?$filter=RequestId eq $[RequestId]"; instead of a custom button. Test browser back and opening an unauthorized destination.

For a command designed for multiple selected rows, use its bulkexecute branch and a compatible service operation. This is a fragment for a supported multi-record command, not a declaration of the missing action:

bulkexecute {
ifany [Closed = true] {
warning("Selection contains a closed request.");
exit;
}
bulkcall MarkTrainingRequest(RequestId) {
when SUCCESS { hideselection(); }
when FAIL { error("${error.Message}"); }
}
}

Supply and authorize MarkTrainingRequest first. Test zero, one, and mixed-state selections, then force one server failure and reconcile each record. Do not assume a bulk UI command guarantees one atomic transaction. ifall [Closed = false] { ... } checks the selected set. bulknavigate carries a selection to a destination designed to receive it. stringify(records, RequestId, JSON) into SelectedKeys; serializes selected values when the receiving contract expects that representation; declare SelectedKeys first and never feed it to concatenated SQL.

Use the projection’s actual stream attribute and keys. The following fragment requires a DemoAttachmentSet entity set keyed by AttachmentId, with a stream attribute FileData:

execute {
download "DemoAttachmentSet(AttachmentId=$[AttachmentId])/FileData";
}

For upload, replace download with upload and require write permission. Try a permitted small file, a denied record, and the service’s size/type limits. Do not embed credentials in the URL.

Other operations need specific contracts: pin(DemoRequestSet, keyref); pins the current record; select(RequestSelector, SavedKeyRef); selects a known generated key reference after creation. homepage(LuName, KeyRef) into TargetUrl; resolves a registered home page; printdialog ReportResultKey; expects a generated report result, not a business ID. copy ReturnedStructure into this; requires compatible structure fields. Declare receiving variables and verify those contracts before using the fragments.

Aurena Agent operations such as agentenabled into AgentReady; and agentcall GetLocalProperty("Training/Settings", "Mode") into ModeValue; additionally depend on installed, permitted agent capabilities. Check readiness before calling. They are not ordinary projection methods and are not necessary for normal server API calls.

Use the build and acceptance checklist before delivering a change.