- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2017 01:03 AM
Hi,
I have Customer Service Application in my Servicenow instance which consists of contracts and entitlements. Each customer company of ours might have 1 or more than 1 contracts and obviously, 1 contract has multiple entitlements. So, after referring to the documentation, I have decided to create two related lists on Incident form --> one for Contract and the other for Entitlements. And to do this, I got to know that I need to create or specify relationship.
The Customer Company name is one of the fields in my Incident form. When the Company is selected, the Related Contracts should be viewed and based on the Contract, the Entitlements should be shown.
I am unable to understand how to do it as I hardly have any knowledge on Servicenow.
Please help. Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2017 03:33 AM
Hi Raju,
Where is the contracts and entitlemensts data stored? I will assume on a different table than incidents, and so the first part seems straight forward - create a relationship between the incident table and the contracts table:
System Definition -> Relationships -> New
Name: incident contracts
Applies to table: incident
Queries from table: ast_contract --> or your contracts table
Script:
(function refineQuery(current, parent) {
// Add your code here, such as current.addQuery(field, value);
current.addQuery('company', parent.company); //company is the field name in your contract table and incident. Might be called u_company if you added it manually...
})(current, parent);
harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2017 03:33 AM
Hi Raju,
Where is the contracts and entitlemensts data stored? I will assume on a different table than incidents, and so the first part seems straight forward - create a relationship between the incident table and the contracts table:
System Definition -> Relationships -> New
Name: incident contracts
Applies to table: incident
Queries from table: ast_contract --> or your contracts table
Script:
(function refineQuery(current, parent) {
// Add your code here, such as current.addQuery(field, value);
current.addQuery('company', parent.company); //company is the field name in your contract table and incident. Might be called u_company if you added it manually...
})(current, parent);
harel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2017 05:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2017 05:32 AM
Hi Harel,
I went and added that Related list to my Incident Form. Thank you. I will get back to you once I test it properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-24-2017 06:07 AM
Hi Harel,
I have done exactly what you told me to do. I have also added the related list to my Incident form. But the related list shows all the Contracts in my instance instead of showing just the ones related to the particular company.
What should I do here. Thanks in advance.