- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2019 06:36 PM
How to pass parameters from Client Side to Server Side in one UI Action.
However, the parameter is not a table field.
UI Action
// Client Side Script
function onClickUIAction(){
var askResonDialog = new GlideModal("askResonDialog");
askResonDialog.on("closeconfirm", function () {
// I want to pass this parameter to the server.
var reason = this.getPreference("reason");
gsftSubmit(null, g_form.getFormElement(), "thisUIAction");
});
askResonDialog.render();
}
// Server Side Script
if (typeof window == 'undefined') {
// I want to receive a "reason" here.
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
-
Studio

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2019 07:39 PM
this.getPreference() will not work in client side , you have to pass it in your server side code.
if you want to use getPreference() use glide ajax here.
Here you have to create one Client callable script include and then use that script include using glide ajax into your ui action client side script.
kindly have a look on glide ajax example doc link below.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2019 07:39 PM
this.getPreference() will not work in client side , you have to pass it in your server side code.
if you want to use getPreference() use glide ajax here.
Here you have to create one Client callable script include and then use that script include using glide ajax into your ui action client side script.
kindly have a look on glide ajax example doc link below.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-26-2024 07:23 AM
//Client Script
api.controller = function ($scope, $rootScope, $timeout, $interval) {
/* widget controller */
var c = this;
this.saveData = function(){
var payload = {};
payload.data = {};
$scope.data.param = 'data';
$scope.data.action = 'saveData';
payload.data["Action"] = "SaveData";
$scope.server.update();
};
};
};
//Server Script
(function () {
if (input && input.action == 'saveData' ) {
gs.addInfoMessage(input.param);
}
})();