Comments on: Prevent Circular Relationships in ServiceNow https://servicenowguru.com/business-rules-scripting/prevent-circular-relationships-servicenow/ ServiceNow Consulting Scripting Administration Development Thu, 07 Mar 2024 16:15:07 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Jim Pisello https://servicenowguru.com/business-rules-scripting/prevent-circular-relationships-servicenow/#comment-8415 Fri, 14 Jul 2017 16:45:05 +0000 https://servicenowguru.wpengine.com/?p=3457#comment-8415 In reply to Renuka.

Hi Renuka,

It is easy to create custom category/subcategory structures in ServiceNow. Just navigate to Service Catalog >> Maintain Categories.

If you need more assistance you can review this ServiceNow Docs article or post your question on the ServiceNow Community Forum.

]]>
By: Renuka https://servicenowguru.com/business-rules-scripting/prevent-circular-relationships-servicenow/#comment-8414 Tue, 23 May 2017 13:43:29 +0000 https://servicenowguru.wpengine.com/?p=3457#comment-8414 Hi Mark,

I have a requirement where in i need to insert the category values.
Example : App/Mobile/Laptop

1) App should be inserted as title
2) Mobile should be inserted as title and App should be parent of title App
3) Laptop should be inserted as title and App/Mobile should be parent of title Mobile

This is into sc_category table.
Please let me know feasible solution for this.

]]>
By: Mark Stanger https://servicenowguru.com/business-rules-scripting/prevent-circular-relationships-servicenow/#comment-8413 Thu, 30 Apr 2015 16:19:55 +0000 https://servicenowguru.wpengine.com/?p=3457#comment-8413 In reply to Dan.

I agree. Thanks for the feedback, I’m glad the solution helped you!

]]>
By: Dan https://servicenowguru.com/business-rules-scripting/prevent-circular-relationships-servicenow/#comment-8412 Thu, 30 Apr 2015 16:18:51 +0000 https://servicenowguru.wpengine.com/?p=3457#comment-8412 In reply to Matt.

Why this isn’t OOB functionality is beyond me. Mark saves the day again!

]]>
By: Matt https://servicenowguru.com/business-rules-scripting/prevent-circular-relationships-servicenow/#comment-8411 Thu, 26 Jun 2014 14:42:07 +0000 https://servicenowguru.wpengine.com/?p=3457#comment-8411 Where has this been all my life? :)

I hope this solution can help me prevent circular CI relationships.

]]>
By: Mark Stanger https://servicenowguru.com/business-rules-scripting/prevent-circular-relationships-servicenow/#comment-8410 Thu, 12 May 2011 09:48:18 +0000 https://servicenowguru.wpengine.com/?p=3457#comment-8410 In reply to Wesley.

Looks cool. I’ll have to check it out. Thanks for sharing!

]]>
By: Wesley https://servicenowguru.com/business-rules-scripting/prevent-circular-relationships-servicenow/#comment-8409 Thu, 12 May 2011 09:38:15 +0000 https://servicenowguru.wpengine.com/?p=3457#comment-8409 I was actually implementing something similar when I came across the RecursionTester object which is part of the business rule checking the sys_db_object table for recursion. Just thought i’d share it:

 
var rt = new RecursionTester('sys_db_object', 'super_class');
 
if (rt.isRecursive(current)) {
 
current.setAbortAction(true);
 
current.parent.setError('Invalid Parent');
 
gs.addErrorMessage('The selected parent loops back to this record (recursive loop)');
 
}
 

 
// Prevent duplicates
 
if (current.operation() == 'insert') {
 
var dup = new GlideRecord('sys_db_object');
 
dup.addQuery('name', current.name);
 
dup.query();
 
if (dup.hasNext()) {
 
current.setAbortAction(true);
 
current.name.setError('Object already defined for ' + current.name);
 
gs.addErrorMessage('Object already defined for ' + current.name);
 
}
 
}
 
]]>
By: Mark Stanger https://servicenowguru.com/business-rules-scripting/prevent-circular-relationships-servicenow/#comment-8408 Wed, 16 Mar 2011 12:47:23 +0000 https://servicenowguru.wpengine.com/?p=3457#comment-8408 In reply to Steve Darity.

Thanks for your comment Steve. It makes it much more worthwhile to share this stuff if I know that it’s helping somebody. :)

]]>
By: Steve Darity https://servicenowguru.com/business-rules-scripting/prevent-circular-relationships-servicenow/#comment-8407 Wed, 16 Mar 2011 12:41:45 +0000 https://servicenowguru.wpengine.com/?p=3457#comment-8407 Now that is Awesome. Thank Your for all of your contributions and well documented solutions and suggestions. Great Website.

]]>