- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2023 04:05 AM
Hi Team ,
am using server script to update the multi row variable set field by using below syntax
g_form.setValue('amount', '200');
but enable to update ,
Please guid me
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 12:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2023 04:45 AM
@String ,
You need to do something like mentioned below:
This is a sample script not exact scenario please modify your code according to mention script below:
Client SIde:
var inputs = {
"shipid" : $scope.page.g_form.getValue(shipid');,
"billto" : $scope.page.g_form.getValue(billto');
}
c.server.get(inputs).then(function(resp){
var resp = JSON.parse(resp);
$scope.page.g_form.setValue('amount',resp.amount);
$scope.page.g_form.setValue('quantity',resp.quantity);
})
Server Side:
if(input){
var billto = input.billto;
var shipid = input.shipid;
//make API call by passing the variables
//parse the data and return the output as json as
var result = {"id":"xxx" , "amount":"123","quantity" : "12"};
return JSON.stringify(result);
}
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2023 05:29 AM
just to understand the flow I have hard coded the result to 200 and trying to update the form ,but not working
Please guide
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2023 05:42 AM
@String ,
Please replace your previous code and modify according to my recent reply and write the c.server.get code in the button $scope.clickmethod
If my answer solved your issue, please mark my answer as ✅Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2023 06:00 AM
client controller :