Skip to main content

Redirection

Your backend can send the user to a different form or URL after an action completes. Use RedirectTo to navigate within your app or to an external URL.

When your handler calls RedirectTo(), the command is returned in the /runevent response. The SDK receives it and performs the navigation.


RedirectTo command

{
"command": "RedirectTo",
"args": {
"url": "/forms/customers"
}
}

C# implementation

// Navigate to a list form after saving
RedirectTo("/forms/customers");

// Navigate to a specific record
RedirectTo($"/forms/orders/{orderId}");

// Navigate to an external URL
RedirectTo("https://example.com/confirmation");

Typical use cases

Redirect after save

public async Task Form_onClick(string widgetName)
{
if (widgetName == "savebtn")
{
var id = await CreateOrder(record.GetData());

ShowMessage("success", "Order created.");
RedirectTo($"/orders/{id}");
}
}

Redirect after delete

public async Task Form_onClick(string widgetName)
{
if (widgetName == "deletebtn")
{
await DeleteRecord(Context.Guid);
ShowMessage("success", "Record deleted.");
RedirectTo("/forms/records");
}
}

Opening a form in a modal

For non-destructive navigation — when you want to open another form without leaving the current context — use OpenModal instead. See Opening New Form in Modal Window.