- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi everyone,
I’m trying to create a button in Workspace that performs client-side validation (e.g., checking field values) and only executes server-side logic if all client-side checks pass.
In classic forms, this is straightforward with UI Actions. However, in Workspace, using Form Actions feels more complex, and it seems like buttons are either purely client-side or server-side.
What I’m trying to achieve (simplified example):
- If
current.variable('abc') == "true"→ execute server-side logic (e.g., setcurrent.status = 3and update the record) - Otherwise → stay on the client side and show an error message (
g_form.showErrorMessage('Error'))
What’s the recommended approach to implement this in Workspace? Is there a way to combine client-side validation with conditional server-side execution in a single button?
ChatGPT doesn’t really help me here — I need an answer from someone with real hands-on experience.
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Thx to all. Not working with Builder so far due to limitations (like most of the new stuff… mostly the f*cking FLOW BS — loved my workflow ), but ok — can’t turn back time
I was NOT aware of the workspace part after the script field in the UI Action for Workspace…!!
That is doing the trick.
So ... UI Action as usual with client and server-side coding via…
// client side checks before ...
...
//serverside
... and workspace part adding the same ... and at the end the action is called witch is only set in the upper script filed.
function onClick() { var test = g_form.getValue('test'); g_form.clearMessages(); if (!test) { g_form.addErrorMessage(getMessage('test_msg')); return false; } g_form.setValue('approval', 'rejected'); g_form.submit('my_action_name'); // Action name }
Works now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Thx to all. Not working with Builder so far due to limitations (like most of the new stuff… mostly the f*cking FLOW BS — loved my workflow ), but ok — can’t turn back time
I was NOT aware of the workspace part after the script field in the UI Action for Workspace…!!
That is doing the trick.
So ... UI Action as usual with client and server-side coding via…
// client side checks before ...
...
//serverside
... and workspace part adding the same ... and at the end the action is called witch is only set in the upper script filed.
function onClick() { var test = g_form.getValue('test'); g_form.clearMessages(); if (!test) { g_form.addErrorMessage(getMessage('test_msg')); return false; } g_form.setValue('approval', 'rejected'); g_form.submit('my_action_name'); // Action name }
Works now.
