How to create a primary key for Combination of two fields in servicenow

rc26
Tera Contributor

I want to configure a composite primary key for combination of both fields in a table.

 

Thanks!!

 

 

3 REPLIES 3

rc26
Tera Contributor

I want only if both values entered are already in system then unique key violation error should come. Basically primary key on combination of both fields. But as per the solution provided above its not allowing even if one of the field is same.

You must make sure the combination has no duplicates to create a unique index. Common database requirement, not unique to Servicnow. Or do not check "Unique index". There are plenty of examples in the sys_index table.