- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
08-07-2024 09:30 PM - edited 10-02-2024 12:08 AM
EDIT: This bug has been fixed in Washington Patch 6.
The Washington release introduced a wealth of new features to ServiceNow, including the highly anticipated ‘Save as Draft’ functionality for portal forms. This feature allows users to save incomplete forms as drafts and return later to finish and submit them.
However, the feature was accompanied by a bug. In this article, we will explore the nature of this bug, outline the steps to reproduce it, provide both a temporary workaround and a permanent solution.
Bug
Attachments don’t get copied to target records if the draft function is used on record producers.
Steps to reproduce
- Navigate to Employee Center (ESC) Portal
- Open any record producer form and fill it out
- Add an attachment to the form
- Click on ‘Save as Draft’
- Navigate to saved drafts by clicking on ‘View Drafts’ or ‘My Requests’
- Open the draft and click on ‘Submit’
- Navigate to the target record in the backend
- Verify that the attachment did not get added to the record
Temporary workaround
Upon further investigation, it was noted that the attachment exists in the Attachment [sys_attachment] table while the record is in draft status but gets deleted once the draft is submitted. Interestingly, when in draft status, the table_sys_id column for the attachment in the Attachment table contained the sys_id of the record that was yet to be created by the record producer.
So to fix the issue, we just had to prevent the auto-deletion of the added attachment if the delete operation is happening immediately after the target record is inserted.
Business rule configuration
- Navigate to Business Rules table and proceed to create a new rule.
- Set the values as follows –
- Name – anything
- Table – Attachment [sys_attachment]
- Advanced – true
- When – before
- Delete – true
3. Under the ‘Advanced’ tab, the script should look like the below.
- Copyable version of the script can be found here.
4. Try to reproduce the issue and notice that the added attachments do not vanish anymore.
Permanent solution
ServiceNow support has commented that this bug will be fixed as part of the Xanadu release, and that there are multiple Problem records open for it. One of them being PRB1752131.
Next steps
If Washington is the version you are using for a few more months, better to have this workaround in place than vanishing attachments. Implement it and share among your peers.
- 1,349 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Thanks for sharing.
Regards,
Priyanka Salunke
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Saura Sambit Do you think it could work the same to retain the draft after submission?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
FYI,
I have tested this in Washington DC patch 6, and it seems to work OOTB.
Regards,
Pablo Espinar
Holcim
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Tuck Wai Can you elaborate more on what you mean about 'retain the draft'?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@pespinar They seem to have released the fix in patch 6. I will edit the content.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
@Saura Sambit I mean when user submit the draft, instead of system discarding the draft and creating a RITM, I want the system to abort the deletion of the draft while still creating the RITM. That way I have both a submitted draft and RITM. I tried to use your method to achieve this but it didn't work, presumably because I could not find a sys_id that was reused - like you mentioned, "the table_sys_id column for the attachment in the Attachment table contained the sys_id of the record that was yet to be created by the record producer."
Do you think there is a way to achieve my objective?