none
Creating a mandatory field based on another field's input - FIM 2010 R2 RRS feed

  • Question

  • Hi Team,

    How can one create a mandatory text field based on an input or selected value of another field (boolean) in FIM? OK, here is my case:

    I have a custom resource in FIM with a boolean attribute. I also have another field (text box) that is dependent on the boolean's selected value. If yes is selected, the text box should become visible and require input. Otherwise, it should remain hidden.

    Else, I could have all the attributes visible but the text box must require an input if Yes on the boolean is selected.

    How can this be achieved? This has got my head cracking... any clues?

    Monday, November 10, 2014 8:09 AM

Answers

  • Hello,

    yes this is mostly possible, except of the required thing, you must check this maybe in a workflow.

    I've done something similar when a customer need a helpdesk password reset function in portal.
    I've adapted the following from the "email enabling groups RCDC"

          <my:Control my:Name="ChangeUserPassword" my:TypeName="UocCheckBox" my:Caption="{Binding Source=schema, Path=ChangeUserPassword.DisplayName}" my:RightsLevel="{Binding Source=rights, Path=ChangeUserPassword}" my:AutoPostback="true">
            <my:Properties>
              <my:Property my:Name="Checked" my:Value="{Binding Source=object, Path=ChangeUserPassword, Mode=TwoWay}" />
            </my:Properties>
          </my:Control>
          <my:Control my:Name="ResetPasswordAdmin" my:TypeName="UocTextBox" my:Caption="{Binding Source=schema, Path=ResetPasswordAdmin.DisplayName}" my:RightsLevel="{Binding Source=rights, Path=ResetPasswordAdmin}" my:Hint="%SYMBOL_NewPasswordHint_END%" my:Visible="{Binding Source=object, Path=ChangeUserPassword, Mode=TwoWay}">
            <my:Properties>
              <my:Property my:Name="Required" my:Value="true" />
              <my:Property my:Name="Columns" my:Value="34" />
              <my:Property my:Name="MaxLength" my:Value="128" />
              <my:Property my:Name="Text" my:Value="{Binding Source=object, Path=ResetPasswordAdmin, Mode=TwoWay}" />
            </my:Properties>
          </my:Control>
          <my:Control my:Name="ChangePasswordOnLogon" my:TypeName="UocSimpleRadioButton" my:Caption="{Binding Source=schema, Path=ChangePasswordOnLogon.DisplayName}" my:RightsLevel="{Binding Source=rights, Path=ChangePasswordOnLogon}" my:Hint="%SYMBOL_ChangePasswordOnLogonHint_END%" my:Visible="{Binding Source=object, Path=ChangeUserPassword, Mode=TwoWay}">
            <my:Properties>
              <my:Property my:Name="FalseText" my:Value="%SYMBOL_RadioBoxFalseText_END%" />
              <my:Property my:Name="TrueText" my:Value="%SYMBOL_RadioBoxTrueText_END%" />
              <my:Property my:Name="SelectedItem" my:Value="{Binding Source=object, Path=ChangePasswordOnLogon, Mode=TwoWay}" />
            </my:Properties>
          </my:Control>
    

    Have a look at the "AutoPostback" attribute which sets the value directly on the object and not when you submit the request.

    Check also the myVisible attribute, where I used the attribute which I set with postback earlier.

    look like the following in my portal:

    The last 2 attributes are only visible if the "Reset Password ?" attribute is selected (true).

    You can also use any boolean attribute, even without "AutoPostback" as the input value for "myVisible"

    Regards
    Peter


    Peter Stapf - ExpertCircle GmbH - My blog: JustIDM.wordpress.com

    • Marked as answer by Josephine254 Monday, November 10, 2014 1:23 PM
    Monday, November 10, 2014 11:19 AM
  • Hi,

    this is quite simple.

    You define the symbols in the translation/language XML part of the RCDCs.

    Simple export the current language, add symbols like you need, an re-upload the XML to the language definition of the RCDC. There will be 1 translation xml for each language in each RCDC.

    You can then use these symbols in your RCDC UI config

    Be careful on applying hotfixes to fim portal/service which contains language packs, as this will reset all language XML to its defaults, you have do reupload you customized XML files after applying hotfixes.

    It's good to have a PowerShell to do this.

    Here is a part of my translation XML of my RCDC from the above example:

      <SymbolResourcePair Symbol="ResetPasswordFalseHint" ResourceString="Password remains unchanged." />
      <SymbolResourcePair Symbol="ResetPasswordTrueHint" ResourceString="Set new password." />
    

    Regards
    Peter


    Peter Stapf - ExpertCircle GmbH - My blog: JustIDM.wordpress.com

    • Marked as answer by Josephine254 Monday, November 10, 2014 1:25 PM
    Monday, November 10, 2014 11:50 AM

All replies

  • Hello,

    yes this is mostly possible, except of the required thing, you must check this maybe in a workflow.

    I've done something similar when a customer need a helpdesk password reset function in portal.
    I've adapted the following from the "email enabling groups RCDC"

          <my:Control my:Name="ChangeUserPassword" my:TypeName="UocCheckBox" my:Caption="{Binding Source=schema, Path=ChangeUserPassword.DisplayName}" my:RightsLevel="{Binding Source=rights, Path=ChangeUserPassword}" my:AutoPostback="true">
            <my:Properties>
              <my:Property my:Name="Checked" my:Value="{Binding Source=object, Path=ChangeUserPassword, Mode=TwoWay}" />
            </my:Properties>
          </my:Control>
          <my:Control my:Name="ResetPasswordAdmin" my:TypeName="UocTextBox" my:Caption="{Binding Source=schema, Path=ResetPasswordAdmin.DisplayName}" my:RightsLevel="{Binding Source=rights, Path=ResetPasswordAdmin}" my:Hint="%SYMBOL_NewPasswordHint_END%" my:Visible="{Binding Source=object, Path=ChangeUserPassword, Mode=TwoWay}">
            <my:Properties>
              <my:Property my:Name="Required" my:Value="true" />
              <my:Property my:Name="Columns" my:Value="34" />
              <my:Property my:Name="MaxLength" my:Value="128" />
              <my:Property my:Name="Text" my:Value="{Binding Source=object, Path=ResetPasswordAdmin, Mode=TwoWay}" />
            </my:Properties>
          </my:Control>
          <my:Control my:Name="ChangePasswordOnLogon" my:TypeName="UocSimpleRadioButton" my:Caption="{Binding Source=schema, Path=ChangePasswordOnLogon.DisplayName}" my:RightsLevel="{Binding Source=rights, Path=ChangePasswordOnLogon}" my:Hint="%SYMBOL_ChangePasswordOnLogonHint_END%" my:Visible="{Binding Source=object, Path=ChangeUserPassword, Mode=TwoWay}">
            <my:Properties>
              <my:Property my:Name="FalseText" my:Value="%SYMBOL_RadioBoxFalseText_END%" />
              <my:Property my:Name="TrueText" my:Value="%SYMBOL_RadioBoxTrueText_END%" />
              <my:Property my:Name="SelectedItem" my:Value="{Binding Source=object, Path=ChangePasswordOnLogon, Mode=TwoWay}" />
            </my:Properties>
          </my:Control>
    

    Have a look at the "AutoPostback" attribute which sets the value directly on the object and not when you submit the request.

    Check also the myVisible attribute, where I used the attribute which I set with postback earlier.

    look like the following in my portal:

    The last 2 attributes are only visible if the "Reset Password ?" attribute is selected (true).

    You can also use any boolean attribute, even without "AutoPostback" as the input value for "myVisible"

    Regards
    Peter


    Peter Stapf - ExpertCircle GmbH - My blog: JustIDM.wordpress.com

    • Marked as answer by Josephine254 Monday, November 10, 2014 1:23 PM
    Monday, November 10, 2014 11:19 AM
  • Thank you Peter.

    That will actually help sort me out. Though one thing that has always challenged me is defining the symbols. For some unknown reason, they have not worked every time I tried to and always return the warning/error... definition of the symbol missing.

    Do you mind throwing some pointers please?

    Once again, much appreciation.

    Monday, November 10, 2014 11:33 AM
  • Hi,

    this is quite simple.

    You define the symbols in the translation/language XML part of the RCDCs.

    Simple export the current language, add symbols like you need, an re-upload the XML to the language definition of the RCDC. There will be 1 translation xml for each language in each RCDC.

    You can then use these symbols in your RCDC UI config

    Be careful on applying hotfixes to fim portal/service which contains language packs, as this will reset all language XML to its defaults, you have do reupload you customized XML files after applying hotfixes.

    It's good to have a PowerShell to do this.

    Here is a part of my translation XML of my RCDC from the above example:

      <SymbolResourcePair Symbol="ResetPasswordFalseHint" ResourceString="Password remains unchanged." />
      <SymbolResourcePair Symbol="ResetPasswordTrueHint" ResourceString="Set new password." />
    

    Regards
    Peter


    Peter Stapf - ExpertCircle GmbH - My blog: JustIDM.wordpress.com

    • Marked as answer by Josephine254 Monday, November 10, 2014 1:25 PM
    Monday, November 10, 2014 11:50 AM
  • Hi Peter,

    It has all worked......Thanks a bunch :). You are great!

    Best regards,

    Josephine.

    Monday, November 10, 2014 1:28 PM