Home Analyst Portal

Hiding enumeration values

Hi.

A customer has a requirement that on some Service Requests (with a specific "Source" or "Area") that some enumeration values, specifically some of the status values are to be hidden. Is this at all possible?

I have envisioned a couple of scenario's to achieve this.

1. Some way to hide the values themselves.
2. Create a custom list, and a workflow to sync that value to the "Status" Property afterwards.
3. Create a custom list, and a JS Custom Task to sync set the status afterwards.

Has anyone done anything like this before?

Best Answers

Answers

  • James_AtanceJames_Atance Cireson Support Advanced IT Monkey ✭✭✭
    Hi,

    Have you look at the following KB?

    https://support.cireson.com/KnowledgeBase/View/24#/


  • Fredrik_BorchseniusFredrik_Borchsenius Customer IT Monkey ✭
    Permanently disabling an enumeration isn't a problem. I did read throught that KB, and it unfortunately doesn't solve the problem. I only need to hide an enumeration if a specific property is set to a pre-defined value. In this case, it has to trigger on the SOURCE prop.
  • Jaime_PalazuelosJaime_Palazuelos Partner IT Monkey ✭
    Hi,

    In case someone looks for a easy and fast script to hide the sealed enumerations:

    $SCSMSQLServer = "YOUR_SERVER_NAME"
    $SQLConnectionString ="Server=$SCSMSQLServer;Initial Catalog=ServiceManagement;Persist Security Info=False;Integrated Security=SSPI;"
    $SQLconnection = New-Object System.Data.SqlClient.SqlConnection($SQLConnectionString)   
    $SQLconnection.Open()

    $ServiceRequestAreaEnums = Get-SCSMEnumeration -Name ServiceRequestAreaEnum | ? {$_.DisplayName -ne 'Service Request Area'}
    foreach($Enum in $ServiceRequestAreaEnums){
        $SQLQuery = "UPDATE Enumeration SET Enabled = 0 WHERE EnumerationID = '$($Enum.Id)'"

        $SQLCommand = New-Object System.Data.SqlClient.SqlCommand($SQLQuery,$SQLconnection)
        $SQLCommand.ExecuteNonQuery()
    }
    $SQLconnection.Close()


Sign In or Register to comment.