CatCategory - Scoped

CatCategory API enables you to create and modify service catalog categories using scripts.

Scoped CatCategory - availableForUserCriteria(String action, Array[] criteriaIDs)

Adds the Available For user criteria to a catalog category.

Table 1. Parameters
Name Type Description
action String Specify add to add the user criteria to the Available For list.

Specify delete to delete the user criteria from the Available For list.

criteriaIDs Array Array of the user criteria sys_ids.
Table 2. Returns
Type Description
void
var item = new sn_sc.CatCategory("31bea3d53790200044e0bfc8bcbe5dec");
item. availableForUserCriteria("add", ["0c441abbc6112275000025157c651c89"]);

Scoped CatCategory - notAvailableForUserCriteria(String action, Array[] criteriaIDs)

Adds the Not Available For user criteria to a catalog category.

Table 3. Parameters
Name Type Description
action String Specify add to add the user criteria to the Not Available For list.

Specify delete to delete the user criteria from the Not Available For list.

Table 4. Returns
Type Description
void
var item = new sn_sc.CatCategory("31bea3d53790200044e0bfc8bcbe5dec");
item. notAvailableForUserCriteria("add", ["0c441abbc6112275000025157c651c89"]);

CatCategory - create(Boolean standardUpdate)

Inserts the defined category.

Table 5. Parameters
Name Type Description
standardUpdate Boolean Set to true to enable the running of engines and workflow.
Table 6. Returns
Type Description
String Return the sys_id of the inserted variable record.

CatCategory - deleteRecord(Boolean standardUpdate)

Brief description of the method.

Table 7. Parameters
Name Type Description
standardUpdate Boolean
Table 8. Returns
Type Description
void

CatCategory - read(Object columns, Boolean standardUpdate)

Returns a mapping of the category.

Table 9. Parameters
Name Type Description
columns Object Specify the set of columns that you would like the values for.
standardUpdate Boolean Set to true to enable the running of engines and workflow.
Table 10. Returns
Type Description
Object An object mapping column names to values.

CatCategory - setAttributes(Object attributes)

Defines attribute values for this category.

Table 11. Parameters
Name Type Description
attributes Object Set the attributes for new field and value pairs.
Table 12. Returns
Type Description
void

CatCategory - setTableName(String tableName)

Define the table name for this category.

Table 13. Parameters
Name Type Description
tableName String Specify the name of the table that extends sc_category.
Table 14. Returns
Type Description
void

CatCategory - update(Object columnValues, Boolean standardUpdate)

Use to update current category.

Table 15. Parameters
Name Type Description
columnValues Object An object mapping column names to values.
standardUpdate Boolean Set to true to enable the running of engines and workflow.
Table 16. Returns
Type Description
void

CatCategory - getID()

Returns the sys_id of the category.

Table 17. Parameters
Name Type Description
None
Table 18. Returns
Type Description
String sys_id of the category.

Example:

        
        var cart=new sn_sc.CatCategory("2809952237b1300054b6a3549dbe5dd4");	
	 var categoryID=cart.getID();
        gs.info(categoryID);

Output:

2809952237b1300054b6a3549dbe5dd4