
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2020 12:27 PM
Hey Comm!
I have a simple task that I am trying to accomplish. I am blanking on the route to take for what I need.
I currently have a UI Action 'Grab Attachments' on the HR Task Table. Simply, it copies the parent attachments and posts them to the Task. I want to create the same scenario, only the other way. I want another UI Acton on the HR Case table, to copy the child task attachments when needed.
Here is what I have for the HR Task table UI:
GlideSysAttachment.copy(current.parent.sys_class_name, current.parent, current.getTableName(), current.sys_id);
current.update();
action.setRedirectURL(current);
gs.addInfoMessage("Attachments have been added!");
gsftSubmit(null, g_form.getFormElement(), 'sysverb_update_and_stay');
First, I thought I could change change the GlideSysAttachment.copy line to state child / task. But I was wrong - I am sure this is simple, but I am unable to accomplish the simple right now. Can someone lend a hand?
Thank you!
-Rob
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2020 05:29 AM
Thanks again everyone!
We are going to take a different route. Users want to be able to email HR Task Attachments in an easier way. In a way that allows them to select which attachments to email. I have a good process for that on the HR Case table - so I am going to recreate that on the HR Task table.
Cheers!
-Rob

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-05-2020 02:56 PM
Hi Rob,
Try to check the "Client" checkbox and see if it works, since you are trying to use gsftSubmit function. But then what is your purpose of calling that function? You need that function only if you are running both Client-side and Server-side code but I am not seeing anything that you need to run on the client side in your UI Action?
Regards,
Phuong
If you find my suggestions helpful, please mark it as correct or helpful to help out others as well 🙂

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2020 05:19 AM
Hey Phuong,
Thanks for your suggestion. I could use the client checkbox - but then I think I would have to create a function from a script include perspective, right?
If my UI Action on the Task form can just be what I showed above to grab attachments from the parent, how come I cannot reverse it?
Thank you!
-Rob

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2020 12:31 AM
pls try using:
var parentGr = current.parent.getRefRecord();
GlideSysAttachment.copy(parentGr.sys_class_name, current.parent, current.sys_class_name, current.sys_id);
action.setRedirectURL(current); gs.addInfoMessage("Attachments have been added!");
gsftSubmit(null, g_form.getFormElement(), 'sysverb_update_and_stay');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-06-2020 04:58 AM
Tried the script - message part worked, but no attachment came over from the Task to the Parent Case.
Thanks,
-Rob

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2020 05:29 AM
Thanks again everyone!
We are going to take a different route. Users want to be able to email HR Task Attachments in an easier way. In a way that allows them to select which attachments to email. I have a good process for that on the HR Case table - so I am going to recreate that on the HR Task table.
Cheers!
-Rob