Skip to main content

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
}
}
}
[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());
}

Parameters:

  • id (string) - Unique identifier for this modal instance
  • pluginCode (string) - Plugin code (empty string if none)
  • formCode (string) - The form to open
  • guid (string|null) - Record GUID, or null for new records
  • pGuid (string|null) - Project GUID
  • originator (object|null) - The widget/form context that triggered the action
    • params — form parameters with pluginCode, formCode, guid, pGuid
    • widgetName — name of the widget that triggered the action
  • parent (object|null) - The form context refreshed when the modal closes
    • params — form parameters with pluginCode, formCode, guid, pGuid
    • widgetName — name of the parent widget
  • isFormEditorMode (boolean|null) - Opens the form in form editor mode when true
  • folderData (object|null) - Folder context data to pass into the modal form
  • prefillData (object|null) - Key/value pairs used to pre-fill fields in the modal form
tip

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"
}
}
}
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"
}
});
}

Parameters:

  • context (object|null) - Optional navigation context
    • referer (string) - URL of the page initiating the redirect, used for back-navigation
  • url (string) - Target URL (absolute or relative)
note

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"
}
}
}
response.Set("FECommand", new Dictionary<string, object>
{
["MoveToTab"] = new { widgetName = "detailsTab" }
});

Parameters:

  • widgetName (string) - Name of the tab widget to activate