Using Document ID field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2014 03:12 PM
Hi folks -
I've a use case where I want to be able to relate a particular "Any" Service Now record (i.e a specific sys_id on any table) I discovered that this can be acheived by adding a field of type DocumentID on the table. Wiki provides information about how to configure it on a form .
However, I do not see more information about how to use that field within scripts to get to that particular related record.
Can someone help me with links to documentation if available .. or provide an example of how I can use the document ID field.
Regards,
Abhijeet

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2014 09:03 PM
As far as scripting on Document ID field is concerned, there is no difference between reference field and document id field. You can use the same syntax to refer to this field.
For Server side scripting you can use this :
gs.addInfoMessage('Document sys id -->'+current.u_document_id);
gs.addInfoMessage('Document Display name -->'+current.u_document_id.getDisplayValue());
For Client side you can do :
alert(g_form.getValue('u_document_id')):
Hope it answers your question.
Regards,
Bhavesh

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2014 08:00 PM
Did that answer your question?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2014 09:18 AM
Hi Bhavesh -
Thanks for such a prompt response. I've been in training last couple of days.
I will try that today/tomorrow & verify. Thanks a ton!
Regards,
Abhijeet
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2014 04:15 PM
Hi folks -
I tried the Document ID field & followed instruction from the Wiki to create the same.
However I don't see many tables visible in the drop down selection.
like Script Includes, Business Rules, UI Policies etc. I needed to build a reference to records from these tables & ideally I would like to use something on the same lines as the document id field so that I can store the references within 1 field.
Any suggestions ..??