- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 11:51 AM
I'm trying to convert the following BR into a custom flow action with a script step. However, I'm having difficulty putting it together. Any help with the input variables, script, and output variables would be greatly appreciated.
The business rule I'm trying to convert:
(function executeRule(current, previous /*null when async*/) {
// Call the script include
new global.u_AttachmentUtils().copyAllAttachmentsToMe(current.parent.sys_class_name.toString(), current.getValue('parent'), current);
})(current, previous);
What I currently have in my flow action, but isn't working:
Any help is greatly appreciated!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2024 02:07 AM
I have created a sample action
Action inputs
Script step:
I tested it with some random incidents. it worked.
Hope this helps.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 12:13 PM - edited 04-23-2024 12:16 PM
Hi @Anderson_R ,
When looking at the business rule, you have 3 parameters.
the 3 parameters are derived from current object. When the input is given to the action step, you need to make sure that it is the same object.
For more details about how to populate the input and generate output, please refer this link.
and this link as well
And let me know, if you need more assistance.
Thank you.
Regards,
Karunakaran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 12:36 PM
Hi Karunakaran,
Thanks for the reply. Yes, the parameters are derived from the current object. So with one of them being current.parent, is this how the input would be configured for it?
Considering:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 12:44 PM
yes, here you can define the type of inputs as per the parameters in the method you have.
In the previous step for the action, you need to make sure the inputs are given correctly from the data panel.
Please let me know, if this is confusing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 01:41 PM
I currently have the parent field defined as a reference name. Does this look correct? I don't see a way to ensure it's retrieving the parent from the current record.
Then for the second parameter, it's not found directly on the current record. I would have to dot walk to it from the current record. As the BR uses current.parent.sys_class_name. How do I create an input for a field that you need to dot walk to?