Home Analyst Portal

Form Type Drop Down List

Vladimir_BudyakVladimir_Budyak Customer IT Monkey ✭
Hi,
I'm confused by situation.
Earlier all worked normally and I created custom forms.
Now, in attempt to add the form in the settings "Assign forms to Active Directories groups" the "Form Type" dropdown list does not work.
Tell me please, what to do in this situation?

Best Answers

  • Vladimir_BudyakVladimir_Budyak Customer IT Monkey ✭
    Answer ✓
    John, thank you!
    You helped me a lot!
    I modified the code a bit. It has become larger, but the input and output of information is more convenient.   
    # Input Data
    PARAM (
        # Set AD Group Name for custom form    
        [STRING]$ADGroupName = "Domain Users",
        # Set name of custom form
        [STRING]$FormKey = "Default",
        # Set ID from Predefined FormTypes
        [ValidateSet(1,2,3,4,5)][INT]$FormTypeID = 1,
        # Set ProjectionName or ProjectionID for custom form
        [STRING]$Projection = "Cireson.Incident.ViewModel",
        # Set form ordinal 
        [INT]$Ordinal = 0
    )
    # Predefine FormTypes
    $FormType = @{}
    $FormType.Add(0,"Unknown")
    $FormType.Add(1,"Incident")
    $FormType.Add(2,"Service Request")
    $FormType.Add(3,"Change Request")
    $FormType.Add(4,"Problem")
    $FormType.Add(5,"Release Record")
    # Do
    if ($Projection -match "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
    {$FormProjectionId = (Get-SCSMTypeProjection -Id $Projection).Id}
    else {$FormProjectionId = (Get-SCSMTypeProjection -Name $Projection$).Id}
    $GroupFormClass = Get-SCSMClass -Name Cireson.GroupForm$
    $ADGroupClass = Get-SCSMClass -Name Microsoft.AD.Group$
    $ADGroup = Get-SCSMObject -Class $ADGroupClass -Filter ("UserName -eq $ADGroupName")
    New-SCSMOBject -Class $GroupFormClass -PropertyHashtable (@{FormKey =  $FormKey; FormType = $FormTypeID; AdGroupId = $ADGroup.Id; Ordinal = $Ordinal; FormProjectionId = $FormProjectionId})
    # Get All Registered Custom Forms
    Get-SCSMObject -Class $GroupFormClass | 
        ft  Id,
            @{N="WIType";E={$FormType[$_.FormType]}},
            FormKey,
            @{N="ADGroup";E={(Get-SCSMObject -Id $_.AdGroupId).UserName}},
            @{N="ProjectionName";E={(Get-SCSMTypeProjection -Id $_.FormProjectionId).Name}},
            FormProjectionId,
            Ordinal -AutoSize


Answers

  • seth_coussensseth_coussens Member Ninja IT Monkey ✭✭✭✭
    What version of the portal are you using?
  • Vladimir_BudyakVladimir_Budyak Customer IT Monkey ✭
    7.3.2012.1
    I think that error occurred with dropdown list after uninstalling the test portal and deleting his management db.  
  • seth_coussensseth_coussens Member Ninja IT Monkey ✭✭✭✭
    It's possible you have conflicting schemas in the DB vs what the CacheBuilder is expecting and maybe things are caching properly. Is there anyway you can upgrade to v8?
  • Vladimir_BudyakVladimir_Budyak Customer IT Monkey ✭
    Thanks, but the upgrade is not possible yet for us...
    We use a lot of custom solutions.
  • seth_coussensseth_coussens Member Ninja IT Monkey ✭✭✭✭
    I see. I'd suggest you take this to support then as they can help you to narrow down the issue. It's not one that has been reported previously, from what I can see.
  • Vladimir_BudyakVladimir_Budyak Customer IT Monkey ✭
    Thank you!
    I'll have a session of remote support in a couple of minutes.
  • Vladimir_BudyakVladimir_Budyak Customer IT Monkey ✭
    Answer ✓
    John, thank you!
    You helped me a lot!
    I modified the code a bit. It has become larger, but the input and output of information is more convenient.   
    # Input Data
    PARAM (
        # Set AD Group Name for custom form    
        [STRING]$ADGroupName = "Domain Users",
        # Set name of custom form
        [STRING]$FormKey = "Default",
        # Set ID from Predefined FormTypes
        [ValidateSet(1,2,3,4,5)][INT]$FormTypeID = 1,
        # Set ProjectionName or ProjectionID for custom form
        [STRING]$Projection = "Cireson.Incident.ViewModel",
        # Set form ordinal 
        [INT]$Ordinal = 0
    )
    # Predefine FormTypes
    $FormType = @{}
    $FormType.Add(0,"Unknown")
    $FormType.Add(1,"Incident")
    $FormType.Add(2,"Service Request")
    $FormType.Add(3,"Change Request")
    $FormType.Add(4,"Problem")
    $FormType.Add(5,"Release Record")
    # Do
    if ($Projection -match "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
    {$FormProjectionId = (Get-SCSMTypeProjection -Id $Projection).Id}
    else {$FormProjectionId = (Get-SCSMTypeProjection -Name $Projection$).Id}
    $GroupFormClass = Get-SCSMClass -Name Cireson.GroupForm$
    $ADGroupClass = Get-SCSMClass -Name Microsoft.AD.Group$
    $ADGroup = Get-SCSMObject -Class $ADGroupClass -Filter ("UserName -eq $ADGroupName")
    New-SCSMOBject -Class $GroupFormClass -PropertyHashtable (@{FormKey =  $FormKey; FormType = $FormTypeID; AdGroupId = $ADGroup.Id; Ordinal = $Ordinal; FormProjectionId = $FormProjectionId})
    # Get All Registered Custom Forms
    Get-SCSMObject -Class $GroupFormClass | 
        ft  Id,
            @{N="WIType";E={$FormType[$_.FormType]}},
            FormKey,
            @{N="ADGroup";E={(Get-SCSMObject -Id $_.AdGroupId).UserName}},
            @{N="ProjectionName";E={(Get-SCSMTypeProjection -Id $_.FormProjectionId).Name}},
            FormProjectionId,
            Ordinal -AutoSize


Sign In or Register to comment.