How to change the below code to $scope.server.get() method in the widget client side ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2024 12:28 AM - edited ‎03-20-2024 10:51 AM
How to change the below code to $scope.server.get() method in the widget client side ?
Client Side:
function loadForm(table, sys_id) {
var f = {};
$scope.data.table = f.table = table;
$scope.data.sys_id = f.sys_id = sys_id;
f.view = $scope.data.view;
return $scope.server.update().then(setupAttachmentHandler);
}
Server Side:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2024 02:06 AM
//Client
//client
c.loadForm= function(table, sys_id) {
c.op = {'table' : table, 'id' _ sys_id};
c.server.get(c.op).then(function(resp) //resp is only needed if you need something from the server
$scope.op = null;
//Here you could use resp.whatever_value you need to send to the client from the server.
});
};
//Server
if(input && input.table && input.id) {
data.table = input.table;
data.sys_id = input.sys_id
}
Something like the above here, depending on what you want to send to server and what the purpose is?
So for this example we call the "c.loadForm" function, and we send table and sys_id to the server, where we set the data.table and data.sys_id accordingly. As you can see it turns to "input.table" and "input.id" - and then you can use it server side for whatever purpose. If you instead need something from the server, then you need
Best regards,
Sebastian Laursen

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-20-2024 10:36 AM - edited ‎03-20-2024 10:48 AM
Hi Sebastian, thanks for the suggestion.
I tried the above suggested code but its not make the form to save or submit. I have updated the server side code as well in the previous post. Please refer that and provide a suggestions.