Display an Error message in Provisioning Form

Which IIQ version are you inquiring about?

Version 8.3

Share all details related to your problem, including any error messages you may have received.

Hello everyone,

I’m currently working on a SailPoint form and I’m having some trouble saving the constraints block. Here’s a snippet of the XML:

<Field displayName="Does the new company require onboarding for more than 50 users?" helpKey="A new company will be set up only when there are 50 or more users to be onboarded. For companies with fewer than 50 users, they should be added into the default &apos;Third Party&apos; company." name="companySize" postBack="true" required="true" type="string">
      <AllowedValuesDefinition>
        <Value>
          <List>
            <String>Yes</String>
            <String>No</String>
          </List>
        </Value>
      </AllowedValuesDefinition>
      <Constraints>
        <Constraint name="companySize" type="Validator">
          <Argument name="Error Message">
            <value>You need to cancel the request if you select 'No'.</value>
          </Argument>
          <Argument name="Script">
            <Script>
              <Source>
                if (companySize != null) {
                if (companySize.equals("No")) {
                return false;
                }
                }
                return true;
              </Source>
            </Script>
          </Argument>
        </Constraint>
      </Constraints>
    </Field>

I’m getting a “The system has encountered a serious error while processing your request. See your system administrator.” error when trying to save the script. If I remove the section, the form saves sucessfully.

Any assistance or advice would be greatly appreciated.

Best regards,
Ashley

@acgsneddon

If your requirement is to have a validation error message if user selects company size as No, you can use below actually, please check and confirm if this suits your requirement

    <Field displayName="Does the new company require onboarding for more than 50 users?" helpKey="A new company will be set up only when there are 50 or more users to be onboarded. For companies with fewer than 50 users, they should be added into the default &apos;Third Party&apos; company." name="companySize" postBack="true" required="true" type="string">
      <AllowedValuesDefinition>
        <Value>
          <List>
            <String>Yes</String>
            <String>No</String>
          </List>
        </Value>
      </AllowedValuesDefinition>
      <ValidationScript>
        <Source>
          if(value!=null)
          {

          if(value.equalsIgnoreCase("No")){
          return "You need to cancel the request if you select 'No'";

          }

          }

        </Source>
      </ValidationScript>
    </Field>
1 Like

@iamksatish
Your proposed solution resolved the scripting issue I was experiencing in SailPoint perfectly. I appreciate the time you took to respond to my query. Thank you!

@acgsneddon

Glad it worked, please mark the solution so that it will be helpful for others as well.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.