Source Record is empty
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2023 11:23 AM - edited 04-04-2023 11:25 AM
Hello everyone. I trying to execute an flow in script, but when I execute it the source record in sys_flow_context
become empty, someone can help me to fix this?
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2023 04:41 PM
Hi Paulo Cesar,
I faced the same issue, this is the script that I created and worked for me:
var inputs = {};
inputs['request_item'] = current; // GlideRecord of table:
inputs['table_name'] = 'sc_req_item';
var contextID = sn_fd.FlowAPI.startFlow('flow_name', inputs);
current.flow_context = contextID;
current.update()
if (contextID) {
var newFlowContext = new GlideRecord('sys_flow_context');
newFlowContext.get(current.flow_context);
newFlowContext.source_table = 'sc_req_item';
newFlowContext.source_record = item.sys_id;
newFlowContext.update();
}
If you think my answers are useful for you, I would appreciate it if you could mark my answers as helpful.
Best regards,
Jim