How to get the workflow context sys_id in the workflow for run script activity.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2017 04:44 AM
Hi,
I need to populate the u_context (referenced to wf_context) in the run script activity of the workflow,
but would need a way to get this into the workflow, any inputs?
- Labels:
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2017 05:36 AM
I need to populate the u_context (referenced to wf_context) on the custom table record. The are 3-4 workflows that run on the record.(some workflows and some sub flows).
There are can be more than one workflow context per record, depends on the no.of workflows you configure.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-10-2017 05:49 AM
In such a case you can use the same script, just change the if to while loop
var id = '';
var gr = new GlideRecord('wf_context');
gr.addQuery("id", current.sys_id);
gr.query()
while(gr.next()){
gr.u_context = gr.sys_id;
gr.update();
}
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2017 01:07 AM
Have you tried the script?
Thanks
Please Hit like, Helpful or Correct depending on the impact of the response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2017 03:55 AM
This will not serve the purpose, the u_context is the reference field to
hold single record, if the script returns many which one would it store,
(will have to identify the intended record in wf_context to be populated
with gr.addQuery which in my case will have to be hardcoded with sys_id or
name and dont think this would be a good idea), so is the reason am trying
to aceive with BR from the wf_context table.
On Fri, Mar 10, 2017 at 1:49 PM, alikuttyka <
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-02-2017 03:24 AM
Did you solve this? I also need to get the workflow context sys_id in workflow run script activity