- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 06:00 AM
Hi there,
how i can add table column as foreign key in table?
Thanks
Best reards,
Pratap Ranawat
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
-
Studio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 06:18 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 06:02 AM
Hi Pratap,
What is the underlying requirement here? Normally ServiceNow admins don't really care about primary keys, foreign keys, and other database layer details. It is handled as part of building your data models (tables, reference fields, etc.)
Which is why I'm curious as to what the goal, objective, requirement, etc. is.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 06:14 AM
Last time I used the term "foreign key" was on MagicTSD / Remedy. I'm going to assume you want a field to be a reference to another table.
For that, define the field with a type of Reference. If you're doing that via the dictionary, you'll be forced to tell it what table you want to reference.
If you're coming from the Magic / Remedy space, forget about the concept of "virtual fields". The reference field itself will visualize the display value from the table its referring to (rather than just a sys_id). If you need more fields from the refering table you can traverse the reference via form customization to pull fields from referred table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 06:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 06:23 AM