none
How to make existing fields required in the incident form

    Question

  • Hi there!

    I'd like to make two existing fields(Affected User, Support group) required in our incident form.

    I already found out, how to add fields/properties (Link). But I want to change existing properties.

    I would do make the fields required by defining the properties as "required" in my derived the incident class.

    But it seems that the "core properties" of the incident class are final - so you can add new ones but you can't change existing ones.

    So:

    1. Can I change the Affected User, Support group properties in the Incident class?

    2. Is there an other way to make them required (eg on form level)?

    Thanks in advance.

    (Workaround is a notification - but that does not satisfy me ,)

     

     


    Wednesday, October 05, 2011 7:57 AM

Answers

  • Hi,

    1. No.

    2. You could create your own custom form (in Visual Studio or Blend) and make the field itself required, but other than that - no.

    Regards
    //Anders


    Anders Asp | Lumagate | www.lumagate.com | Sweden | My blog: www.scsm.se
    Monday, October 10, 2011 7:06 AM
    Moderator

All replies

  • Hi,

    1. No.

    2. You could create your own custom form (in Visual Studio or Blend) and make the field itself required, but other than that - no.

    Regards
    //Anders


    Anders Asp | Lumagate | www.lumagate.com | Sweden | My blog: www.scsm.se
    Monday, October 10, 2011 7:06 AM
    Moderator
  • Anders hey
    requiring fileds is it on the xml file .. by changing the required attribute from "false" to "true" ?
    I tried this way ... my form is submitted without filling the fileds I required to filling them ..
    any Ideas plz ?
    Thursday, November 03, 2011 10:21 AM
  • Hi,
     
    this does not work for default forms. You can use this for your custom forms but not for default forms.

    Peter Forster | MVP Virtual Machine 2002-2011 | Austria | German System Center Blog: www.systemcenterblog.at
    • Proposed as answer by MikLemme Wednesday, January 08, 2014 4:21 PM
    • Unproposed as answer by MikLemme Wednesday, January 08, 2014 4:21 PM
    Thursday, November 03, 2011 10:54 AM
  • hey Peter,

    this is a form and MP that I created ..
    shoud I change somethin else in the xml code?


    Jreij12
    Thursday, November 03, 2011 11:06 AM
  • Hi,

    can you tell me where you use the form? In change activities?

    In general: There is nothing else you have to do beside what you have done already. But currently there is a bug within SCSM and required fields.


    Peter Forster | MVP Virtual Machine 2002-2011 | Austria | German System Center Blog: www.systemcenterblog.at
    Thursday, November 03, 2011 11:58 AM
  • Peter it worked,
    but now I face another problems,

    hope u can help me...

    1st , how can I put the red " * " before the required fields? and to remove them when the field is filled by characters?
    is it through workflows?

    2nd, how can I add to my form , a SortableListView and a buttons beside?

    thx in advance


    Jreij12
    Thursday, November 03, 2011 12:09 PM
  • Hi,

    1st: I do not think that this is possible

    2nd: sounds like you want to add a list picker. Just add within the authoring tool a "List picker" than add this MP into SCSM and to to the library, search your list picker object and fill out the items you want to have in the list.


    Peter Forster | MVP Virtual Machine 2002-2011 | Austria | German System Center Blog: www.systemcenterblog.at
    Thursday, November 03, 2011 12:27 PM
  • >>1. Can I change the Affected User, Support group properties in the Incident class?

    No

    >>2. Is there an other way to make them required (eg on form level)?

    Yes. You can create your own hidden control which must search all necessary controls (already existed) on form and add ValidationRule to binding property.

    Heplful links:
    http://stackoverflow.com/questions/974598/find-all-controls-in-wpf-window-by-type
    http://stackoverflow.com/questions/1342540/access-to-all-controls-from-a-wpf-windows (you must use LogicalTree for TabItems)
    http://stackoverflow.com/questions/1592919/programmatically-change-validation-rule-in-wpf-textbox

    I can approve that this aproach work for all kind of controls (TextBox, UserPicker, ListPicker, DatePicker and so on).


    http://www.scsmsolutions.com/ freemanru (at) gmail (dot) com
    Thursday, November 03, 2011 11:06 PM
    Moderator
  • Anton can you please give me an example on how to validate a userpicker or a listpicker .. validating a text box is working but validation on a list or userpicker is not reached
    Thank you

    Jreij12

    Wednesday, March 28, 2012 6:31 AM
  • Here is the reference between type of the control and property wchich you must use to add validation rule.

    typeof(TextBox) - "Text" property
    typeof(DatePicker) - "SelectedDate" property
    typeof(ListPicker) - "SelectedItem" property
    typeof(SingleInstancePicker) - "Instance" property
    typeof(UserPicker) - "User" property


    http://www.scsmsolutions.com/ freemanru (at) gmail (dot) com

    Wednesday, March 28, 2012 7:54 AM
    Moderator
  • <UserControl x:Class="Signature.FullfilmentRequest.Request"
     	xmlns:smcontrols="clr-namespace:Microsoft.EnterpriseManagement.UI.WpfControls;assembly=Microsoft.EnterpriseManagement.UI.SmControls"	
    	xmlns:scwpf="http://schemas.microsoft.com/SystemCenter/Common/UI/Wpf"
          	xmlns:wpftoolbox="clr-namespace:Microsoft.EnterpriseManagement.UI.WpfToolbox;assembly=Microsoft.EnterpriseManagement.UI.FormsInfra"
    >
    
    	<UserControl.Resources>
            	<ControlTemplate x:Key="ValidateTemplate" >
                		<DockPanel LastChildFill="True">
                    		<TextBlock Foreground="Red" FontSize="26" FontWeight="Bold" FontFamily="Agency FB" DockPanel.Dock="Left">*</TextBlock>
                  			 <AdornedElementPlaceholder />
                		</DockPanel>
    
            	</ControlTemplate>
            
            	<Style x:Key="userPickerError" TargetType="{x:Type smcontrols:UserPicker}" >
                		<Style.Triggers>
                   			<Trigger Property="Validation.HasError" Value="True" />
                		</Style.Triggers>
            	</Style>
            
            	<Style x:Key="listPickerError" TargetType="{x:Type smcontrols:ListPicker}" >
                		<Style.Triggers>
                   	 		<Trigger Property="Validation.HasError" Value="True" />
                		</Style.Triggers>
           	 	</Style>
    
        	</UserControl.Resources>
    
    	<smcontrols:UserPicker Margin="30,20,10,0" Height="24" VerticalAlignment="Top" HorizontalAlignment="Stretch" Width="Auto"  Name="upAffectUser" Style="{StaticResource userPickerError}"  Validation.ErrorTemplate="{StaticResource ValidateTemplate}" wpftoolbox:Validation.ValueRequired="True" >
                 	<smcontrols:UserPicker.User>
                    	<Binding Path="AffectedUser" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged"  >
                            	<Binding.ValidationRules />
                       	</Binding>
              	</smcontrols:UserPicker.User>
         	</smcontrols:UserPicker>
    
    	<smcontrols:ListPicker Height="24" Margin="30,20,10,0" HorizontalAlignment="Stretch" VerticalAlignment="Top" Name="lpRequestType" ParentCategoryId="{Binding Source={x:Static local:Request.guidTypeEnum}}" Style="{StaticResource listPickerError}" Validation.ErrorTemplate="{StaticResource ValidateTemplate}" >
                 	<smcontrols:ListPicker.SelectedItem>
                		<Binding Path="RequestType" Mode="TwoWay" UpdateSourceTrigger="PropertyChanged" >
                 			<Binding.ValidationRules/>
                		</Binding>
                	</smcontrols:ListPicker.SelectedItem>
      	</smcontrols:ListPicker>
    </UserControl>

    This is my code .. where is the problem ? .. userpicker and listpicker arent validated like the required impact listpicker in the scsm 2010 incident form

    Jreij12

    Thursday, March 29, 2012 6:30 AM
  • I was use my own validation rule.

    http://www.scsmsolutions.com/ freemanru (at) gmail (dot) com

    Thursday, March 29, 2012 9:58 AM
    Moderator
  • I was use my own validation rule.

    http://www.scsmsolutions.com/ freemanru (at) gmail (dot) com

    can we make required fields in SCSM 2012 or not.
    Tuesday, September 11, 2012 11:37 AM
  • Any answer to this?
    Friday, September 27, 2013 1:38 PM
  • Any answer to this?
    bump
    Monday, November 18, 2013 1:56 PM
  • Yes we can.
    Thursday, December 19, 2013 3:42 PM
  • I am hesitant to post to the gallery as the solution requires SCSM DLLs and I'm not sure what MS would think but here is a ZIP of my solution that will get you 95% of the way there.  You just need to add some info to your MP and you are all set.

    https://drive.google.com/folderview?id=0BzYKJsTvKTuIaTMwZy15RE9waDQ&usp=sharing

    Thursday, December 26, 2013 3:17 PM
  • Herb, you don't need to include any SCSM dlls with your project.

    In your project's "references", for each SCSM dll, just set "Copy Local" to false. That way, no SCSM DLLs will be copied into your Debug or Release folders when you build the project.

    Friday, December 27, 2013 2:42 PM