Form Type Drop Down List
I'm confused by situation.
Tell me please, what to do in this situation?
Best Answers
-
john_doyle Cireson Support Ninja IT Monkey ✭✭✭✭This was a known issue with 7.3. For anyone else who is still running that version of the portal, you can use PowerShell to define your custom forms.
<p>Import-Module<span> SMLets</span></p> <p>$AdGroupName<span> ="SupportSCSM_AllEndUsers"</span></p> <p>$FormKey<span> ="DefaultEndUser"</span></p> <p><#</p><p>FormTypeId:1 FormTypeName:Incident </p><p>FormTypeId:2 FormTypeName:Service Request </p><p>FormTypeId:3 FormTypeName:Change Request </p><p>FormTypeId:4 FormTypeName:Problem </p><p>FormTypeId:5 FormTypeName:Release Record</p> <p>#></p> <p>$FormType<span> = 4</span></p> <p>$FormProjectionId<span> = "754682cb-c4f5-f9a6-c741-bcdb44e0effb"</span></p> <p>$Ordinal<span> = 2</span></p> <p> </p> <p>$GroupFormClass<span> = Get-SCSMClass -Id 8e6ee384-d75a-78ad-6bfc-00eb123f50ca</span></p> <p>$AdGroupClass<span> = Get-SCSMClass -Id e2386b9b-5364-e438-a317-93836b979c56</span></p> <p>$AdGroup<span> = </span><span>Get-SCSMObject -Class </span><span>$AdGroupClass -Filter </span><span>("UserName -eq $AdGroupName") | select Id </span></p> <p>New-SCSMOBject<span> -Class </span><span>$GroupFormClass -PropertyHashtable </span><span>(@{FormKey = </span> $FormKey<span>; FormType = $FormType; </span><span>AdGroupId = $AdGroup.Id; Ordinal = </span><span>$Ordinal; FormProjectionId = $FormProjectionId})</span></p> Get-SCSMObject<span> -Class $GroupFormClass | ft Id, FormKey, FormType, <span>AdGroupId</span></span>
Set the values for $AdGroupName, $FormKey, $FormType, $FormProjectionId, and $Ordinal. Then run the script. If you have an entry with a missing form type, you will have to delete that entry in the portal, and then run the above code with the required information.
6 -
Vladimir_Budyak Customer IT Monkey ✭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
0
Answers
I think that error occurred with dropdown list after uninstalling the test portal and deleting his management db.
We use a lot of custom solutions.
Set the values for $AdGroupName, $FormKey, $FormType, $FormProjectionId, and $Ordinal. Then run the script. If you have an entry with a missing form type, you will have to delete that entry in the portal, and then run the above code with the required information.