Creating Related Lists for Contract and Entitlements on Incident form

prudhvig
Tera Expert

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.

1 ACCEPTED SOLUTION

oharel
Kilo Sage

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


View solution in original post

7 REPLIES 7

Hi,



I was able to solve it. Actually, it was not company. It was vendor.



Thanks for the supprot.


Excellent


If my response answered your question, please mark it as correct, so it can be removed from the unanswered list.



Thanks


harel


Community Alums
Not applicable
I want to create a related list and create a relationship  between three table  Sow, Implementation, project I want to add the related list in the Project table to display the related sow records. Sow table - Have column  - SOW also have a related list of Implementation table  implementation table - have column - project  Now I need to display the associated sow details as a related list on project Can you help me with the query please. Thanks in advance