I have an on demand process that does an update then I want it to return a string/object and I want to use that return value to update items in a tabular form without submitting the page.
The data would look something like this:
[{"TYPE_ID":"100","TOTAL":"70"},{"TYPE_ID":"200","TOTAL":"25"},{"TYPE_ID":"300","TOTAL":"50"}]
Then when I am updating page items when I encounter a TYPE_ID I would get the total for that TYPE_ID
trname = this.triggeringElement.name;
apex.server.process("GET_TOTAL",
{"x01":firstSeqField},
{dataType: "text", success: function(pData){
//pData would contain a string or json object returned from GET_TOTAL?
$('input[name="' + trname + '"]').each(function(){
row = apex.jQuery(this).closest('tr');
totField = row.find('[name=f12]');
//javascript to get total for type
totField.val(whatever I get for the type);
});
}});
Is JSON the preferred method?
Is the return value from the on demand process a json list or a string? What is the code for manipulating that string when there are multiple rows?