Creating a UI Action where based on a choice field answer need to pop up a UI Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 12:06 AM - edited ‎12-17-2024 12:19 AM
Created a UI Action where based on a choice field answer (Yes/No) needs to perform the next action, i.e. if the answer is Yes it should bring a UI Page as a pop-up and insert the record in a particular table.
If no, the record should be inserted in another table.
I wrote the below script but when I select yes and save form nothing happens..instead after saving if I click again then the UI action works. Please let me know what's wrong here.??

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-17-2024 05:32 AM
The way I have achieved this is by doing something like this:
- Give your UI Action a unique Action name. This will come into play in the code.
- Make sure Client is checked in the UI Action.
- Make sure List v2 Compatible is checked in the UI Action.
- For the Onclick field, put your client side function that shows the dialog box.
function clientfunction() {
if (condition for showing your modal) {
var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
var dialog = new dialogClass('glide_confirm_basic');
dialog.setTitle(new GwtMessage().getMessage('Confirmation'));
dialog.setPreference('title', new GwtMessage().getMessage("Add your message here."));
dialog.setPreference('onPromptComplete', serverSideCallbackFunction);
dialog.render();
}
}
function serverSideCallbackFunction() {
gsftSubmit(null, g_form.getFormElement(), 'THIS MUST BE THE ACTION NAME OF THIS ACTION');
}
//Add the rest of your code here. This is server-side code.
I hope this helps.