- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2015 10:45 PM
Can we reload a form automatically right after attaching files? I wrote a business rule which count up attachments and show the number in the form. But we need to refresh the form to display the new number. So it should be reloaded automatically right after attaching files.
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2015 12:00 AM
Hi Koji, why don't you do this through a client script?
You can use the client function getCurrentAttachmentNumber(sys_id_of_your_record) to get the Attachment Number for your record.
This function just looks-up into the field which holds the attachmentNumber for that record. Here goes how internally ServiceNow has defined this function:
function getCurrentAttachmentNumber(sysid) {
if ($$('.attachmentNumber_' + sysid)[0] == undefined) {
if ($('header_attachment_list_label') == undefined)
return undefined;
else
return $('header_attachment_list_label').down().innerHTML;
}
Clarification: This function is already defined and available in your client code.
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2015 01:49 AM
Hi Berny,
I appreciate your answer! I could resolved my situation.
Thanks & Regards,
Koji
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-28-2019 12:35 PM
What kind of client script?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2023 02:03 AM
Hello @bernyalvarado
I know this is an ancient post, but I don't understand what type of client script it should be in order to close the attachment pop up and reload the form.
I've tried the code with an onSubmit but nothing happens.
Am I missing something?