- 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-25-2024 01:26 AM
Hi @Anderson_R
Yes, you need to create the custom action like a method with its parameter in the business rule.
The current object, dot walked field value from the current object should be passed from the previous step which is in the flow,
How to create a dot walked field as an input:
consider that the dot walked field is a string field. you need to define the input as string here in the action. While giving the input to action in the flow, you can dot walk from the Data picker or you can script it.
Consider a flow -->
1. trigger condition
2. Get record --> this can be from the trigger record
3. call the custom action --> as input, pass the parameters (Get Record, dot walked field value)
4. end
Hope this helps. Please let me know, if you need more details.
If you want to use the OOTB functionality to copy the attachments in flow designer, you can refer the below link.
Thank you.
Regards,
Karunakaran.
- 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-26-2024 06:25 AM
This helped a lot, thank you! I was about to create my custom action and flow, like so:
1. Custom Action Input:
2. Custom Action - Look Up Record Step:
3. Custom Action - Script Step:
4. The Flow - Calling the Custom Action w/Sys ID input.