MS Word document checkbox issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 07:21 AM
Hi All,
We are generating a Word document with the data from the form in one of our custom applications. The checkboxes in some MS Word versions are not displayed in the generated document. I'm using the simple HTML checkbox code to populate the checkbox in the document.
<p style="vertical-align: middle; text-indent: 21.1pt; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: \'Times New Roman\', serif;"><input type="checkbox" id="test">Test Checkbox</input></p>
Any help is appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 07:28 AM
unless you share some more details on what script it is and how it's done we won't be able to help.
Please share the complete script etc
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2023 07:47 AM
Hi Ankur,
Below is the script:
UI Action (Word document script)
new GlideSysAttachment().write(current, current.parent.type.getDisplayValue() + ' ' + current.parent.parent.getDisplayValue() + ' ' + component + '.doc', 'application/msword', current.document.replace(/\s/g, ' '));
Display Business Rule script:
var document = '<p style="text-align: center; margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: \'Times New Roman\', serif;" align="center"><strong> </strong></p><p style="margin: 0in 0in 0.0001pt; font-size: 12pt; font-family: \'Times New Roman\', serif;" align="center"><strong>Document Template</strong></p> <p ><input type="checkbox" id="test">Test Checkbox</input></p>';
I'm previewing the template we generate in ServiceNow's HTML field. The only issue is that the checkbox does not appear in the document after generating the word.