Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Maintenance contract relation with CI

SOLVED
Go to solution
Highlighted
Dusko Milosevic
Regular Collector

Maintenance contract relation with CI

Hi all,
My company need to insert some additional CI in the Maintenance contract form as the spare parts for that contract. In some cases those spare parts are not only for one Maintenance contract. I have to find a way to relate some CI to more than one maintenance contract. Can you help me, please?

Thx,

Dusko Milosevic
7 REPLIES
Dusko Milosevic
Regular Collector

Re: Maintenance contract relation with CI

Service desk 4.5, SP20.

Cheers,

D.
George M. Meneg
Honored Contributor

Re: Maintenance contract relation with CI

Actually you can't. On maintenance contract the only custom fields with validation type equal to Entity Reference you can create is custom person, custom organization and custom code.
menes fhtagn
Robert S. Falko
Honored Contributor

Re: Maintenance contract relation with CI

Dusko,

From SP 17 on in v 4.5 you can create a so-called "Generic Relation" between any two items. This may meet your requirement, but remember that there is no built-in logic associated with generic relations and the only way you can use them for something other than a simple list, is to develop your own logic via the Web API.

However, if you object is just to list all the maintenance contracts that cover a given CI, you can do this with Generic Relations.

-Josh
Dusko Milosevic
Regular Collector

Re: Maintenance contract relation with CI

Josiah,

Can you, please, describe me how to do it.

Thx,

D.
Robert S. Falko
Honored Contributor
Solution

Re: Maintenance contract relation with CI

1. In the Admin Console, go to data -> codes -> general - generic relations type
2. Create a new generic relation type. Give it any name you want. The "from" will be "Configuration Item", the "to" will be "Maintenance Contract" (or the opposite !)
3. In the forms for the CIs and for the Maintenance Contracts, add the field "Incoming generic relations" in the one, and "Outgoing generic relations" in the other.
4. Open a CI with the new form. Click on the add button for the generic relations. Select your maintenance contract. You may add as many as you wish.

-Regards,
Josh

PS: I always forget which is incoming and which is outgoing - you can try both to see which one is right.
George M. Meneg
Honored Contributor

Re: Maintenance contract relation with CI

Hello Dusko,

What Josh wrote is quite write but have in mind that you won't be able to view the "spare parts" using sd views. You must open the 'maintenance contract' form and you will see it at 'outgoing relations' (providing that your custom relation is from maintenance contract to ci and not vice versa). Also you can see it on the form of the ci at the 'incoming relations'.

A quick sql query to view the existing generic relations through sql is (using english names, that is lng_oid=1033):

select rct.rct_name as 'Generic relation Name',
ent_from.ent_name as 'Entity From',
ent_to.ent_name as 'Entity To'
from IFC_GENERICRELATIONS grl inner join REP_CODES_TEXT rct on grl.grl_rcd_oid=rct.RCT_RCD_OID
inner join REP_CODES rcd on rcd.RCD_OID=rct.RCT_RCD_OID
inner join ifc_entities ent_from on ent_from.ENT_OID=rcd.RCD_FROM_ENT_OID
inner join ifc_entities ent_to on ent_to.ENT_OID=rcd.RCD_TO_ENT_OID
where rct.RCT_LNG_OID=1033
menes fhtagn
Dusko Milosevic
Regular Collector

Re: Maintenance contract relation with CI

Thanx, just the thing I needed.

D.
//Add this to "OnDomLoad" event