not able to update the subflow output in ui action

akankshak15
Tera Guru

Hi All,

i have a outbound integration ,where i have to hit the API and a record is getting created at the third party tool and a unique number is getting generated , 

i have configured this through the subflow and calling this sub flow through the UI action 

the issue is  i am not able to call the subflow through the ui action also once integration is done and unique number is generated i have to update the number in the record and also show the msg line unique number is generated and if fail to generate the number then have to show the error msg.

 

ui action code:

try {
var inputs = {};
inputs['unq_number'] = current; // GlideRecord of table: x_htawa_claim_au_0_claim_intake

// Start Asynchronously: Uncomment to run in background. Code snippet will not have access to outputs.
// sn_fd.FlowAPI.getRunner().subflow('scoped_app.create_record').inBackground().withInputs(inputs).run();

// Execute Synchronously: Run in foreground. Code snippet has access to outputs.
var result = sn_fd.FlowAPI.getRunner().subflow('scoped_app.create_record').inForeground().withInputs(inputs).run();
var outputs = result.getOutputs();

// Get Outputs:
// Note: outputs can only be retrieved when executing synchronously.
var num = outputs['num_id']; // String

if (num == 'undefined') { // changed the condition
gs.addErrorMessage("That request was not submitted. Please try again after some time.");
} else {

gs.addInfoMessage("The claim is submitted and Claim Number " +num + " has been generated in IVOS. ");
current.update();
//return;
}
} catch (ex) {
var message = ex.getMessage();
gs.error(message);
// gs.addErrorMessage("That request was not submitted. Please try again after some time.");

// return;
}
current.update();
action.setRedirectURL(current);

 

 

please help me to correct the code

1 ACCEPTED SOLUTION

akankshak15
Tera Guru

issue is resolved thank you All

View solution in original post

1 REPLY 1

akankshak15
Tera Guru

issue is resolved thank you All