- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 02:31 PM - edited 10-05-2022 02:55 PM
I am getting the value of the content of a field in a Record Producer using a widget.
I am trying to pass that value from the Client Controller into the Server side of the Widget.
I have an alert pop-up, and it seems to display the desired value from the field.
The Logs return 'undefined'.
I eventually want to use that field value and query a record from a table using that sys_id, but I can't get that sys_id to pass from the controller to the server.
CLIENT CONTROLLER:
api.controller=function($scope) {
/* widget controller */
var c = this;
c.uiAction = function(action){
c.data.action = action;
var i=$scope.page.g_form.getValue('field_name');
alert("The value is "+i);
c.server.update().then(function(){
c.data.action = undefined;
c.data.i = i;
})
}
};
SERVER:
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
if (input){
gs.info("fieldName value is "+input.i); <---Returning undefined in the logs
}
})();
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 03:50 PM
Try moving c.data.i to before c.server.update(). I don't see that it needs to be defined after c.server.update and I'm not seeing it work that way when I test it in my PDI.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2022 03:50 PM
Try moving c.data.i to before c.server.update(). I don't see that it needs to be defined after c.server.update and I'm not seeing it work that way when I test it in my PDI.
