Navigation
Commands that move the user to a different view, open a modal, or refresh the navigation structure.
OpenModal
Opens a form in a modal window.
When to use: Opening forms from buttons, table row clicks, or any action that needs to display another form.
JSON Response:
{
"feCommand": {
"OpenModal": {
"id": "c01d1115-64f6-40ee-b16a-f16f8a351d94",
"pluginCode": "NONE",
"formCode": "FORM002",
"guid": null,
"pGuid": null,
"originator": {
"params": {
"pluginCode": "construct",
"formCode": "documents",
"guid": "index",
"pGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1"
},
"widgetName": "documentstbl"
},
"parent": {
"params": {
"pluginCode": "construct",
"formCode": "documents",
"guid": "index",
"pGuid": "38I9rEPw1BmxP75XcxgzD5WGOk1"
},
"widgetName": "documentstbl"
},
"isFormEditorMode": false,
"folderData": null,
"prefillData": null
}
}
}
- C# / .NET
- PHP
[HttpPost("runevent")]
public async virtual Task<IActionResult> RunEvent([FromBody] PluginContextEventRequestDto request)
{
HandlerResponse response = new HandlerResponse();
response.Set("fieldAllowedValues", null);
response.Set("data", null);
response.Set("widgetData", new(){});
response.Set("definition", null);
response.Set("widgetsState", null);
string? widgetName = request.WidgetName?.ToUpper();
string? baseEvent = request.WidgetEvent?.ToUpper();
OriginatorDto originator = new OriginatorDto
{
widgetName = null,
@params = new RecordRequestDto
{
pluginCode = request.PluginCode,
formCode = request.FormCode,
guid = request.Guid,
pGuid = request.PGuid
}
}
OriginatorDto parent = originator;
if (string.Equals(widgetName, "ADDNEWRECBTN"))
{
response.Set("FECommand", new Dictionary<string, object>
{
["OpenModal"] = new
{
id = Guid.NewGuid().ToString(),
pluginCode = "NONE",
formCode = "FORM002",
guid = (string)null,
pGuid = (string)null,
originator = originator,
parent = originator
}
});
}
return Ok(await response.Get());
}
public function runEvent(Request $request)
{
$response = [
'fieldAllowedValues' => null,
'data' => null,
'widgetData' => [],
'definition' => null,
'widgetsState' => null,
'feCommand' => []
];
$widgetName = strtoupper($request->input('widgetName', ''));
$originator = [
'widgetName' => null,
'params' => [
'pluginCode' => $request->input('pluginCode'),
'formCode' => $request->input('formCode'),
'guid' => $request->input('guid'),
'pGuid' => $request->input('pGuid')
]
];
$parent = $originator;
if ($widgetName === 'ADDNEWRECBTN') {
$response['feCommand']['OpenModal'] = [
'id' => uniqid('', true),
'pluginCode' => 'NONE',
'formCode' => 'FORM002',
'guid' => null,
'pGuid' => null,
'originator' => $originator,
'parent' => $parent
];
}
return response()->json($response);
}
Parameters:
id(string) - Unique identifier for this modal instancepluginCode(string) - Plugin code (empty string if none)formCode(string) - The form to openguid(string|null) - Record GUID, ornullfor new recordspGuid(string|null) - Project GUIDoriginator(object|null) - The widget/form context that triggered the actionparams— form parameters with pluginCode, formCode, guid, pGuidwidgetName— name of the widget that triggered the action
parent(object|null) - The form context refreshed when the modal closesparams— form parameters with pluginCode, formCode, guid, pGuidwidgetName— name of the parent widget
isFormEditorMode(boolean|null) - Opens the form in form editor mode whentruefolderData(object|null) - Folder context data to pass into the modal formprefillData(object|null) - Key/value pairs used to pre-fill fields in the modal form
In most cases originator and parent are the same. They can differ in nested modal scenarios where a different parent form needs to be refreshed.
Redirect
Redirect the browser to a different URL.
When to use: Navigating to external pages, logging out, or redirecting after form submission.
JSON Response:
{
"feCommand": {
"Redirect": {
"context": {
"referer": "/forms/FORM001/record-123"
},
"url": "/dashboard"
}
}
}
- C# / .NET
- PHP
if (string.Equals(widgetName, "SUBMITBTN"))
{
string newRecordGuid = SaveFormData(request.FormData);
response.Set("FECommand", new Dictionary<string, object>
{
["Redirect"] = new
{
context = new { referer = request.RequestUrl ?? "/" },
url = "/dashboard"
}
});
}
if ($widgetName === 'SUBMITBTN') {
$referer = $request->headers->get('referer') ?? $request->url();
$response['feCommand']['Redirect'] = [
'context' => ['referer' => $referer],
'url' => '/dashboard'
];
}
Parameters:
context(object|null) - Optional navigation contextreferer(string) - URL of the page initiating the redirect, used for back-navigation
url(string) - Target URL (absolute or relative)
The referer is typically stored in session or URL state by the frontend so the user can navigate back to the originating page.
MoveToTab
Switch to a specific tab in a tabbed form layout.
When to use: Directing user attention to a specific tab, especially after validation errors.
JSON Response:
{
"feCommand": {
"MoveToTab": {
"widgetName": "detailsTab"
}
}
}
- C# / .NET
- PHP
response.Set("FECommand", new Dictionary<string, object>
{
["MoveToTab"] = new { widgetName = "detailsTab" }
});
$response['feCommand']['MoveToTab'] = ['widgetName' => 'detailsTab'];
Parameters:
widgetName(string) - Name of the tab widget to activate