Identity Provisioning Policies - Update identity

Dear comunnity, im trying to create a form for update identity but its failing


my intention is update the lastname of an identity

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Form PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Form created="1698325712438" id="c0a8b28f8b6b1b5a818b6c19ce360081" modified="1698325774473" name="Edit-Identity-Form-Base" type="UpdateIdentity">
  <Attributes>
    <Map>
      <entry key="pageTitle" value="Edit-Identity-Form-Base"/>
    </Map>
  </Attributes>
  <Description></Description>
  <Section name="Section 1">
    <Field displayName="label_name" displayOnly="true" name="name" type="string">
      <Attributes>
        <Map>
          <entry key="hidden">
            <value>
              <Script>
                <Source>
                import sailpoint.tools.Util;
                import sailpoint.object.Identity;
                
                if(Util.isNullOrEmpty(value)) {
                   Identity cube = context.getObjectById(Identity.class, identityId);
                   if(cube != null) {
                     field.setValue(cube.getName());
                   }
                }
                return false;
                </Source>
              </Script>
            </value>
          </entry>
        </Map>
      </Attributes>
    </Field>
    <Field displayName="Display Name" name="displayName" type="string">
      <Attributes>
        <Map>
          <entry key="hidden">
            <value>
              <Script>
                <Source>
                import sailpoint.tools.Util;
                import sailpoint.object.Filter;
                import sailpoint.object.Identity;
                import sailpoint.object.QueryOptions;
                
                String middleName = form.getField("middleName").getValue();
                String displayNameNew = firstname + " " + lastname;
                
                if(Util.isNullOrEmpty(lastname) || Util.isNullOrEmpty(firstname)) {
                   field.setValue("");
                   return false;
                }
                
                if(Util.isNotNullOrEmpty(middleName)) {
                  displayNameNew = firstname + " " + middleName + " " + lastname;
                }
                
                field.setValue(displayNameNew) ;
                return false;
                </Source>
              </Script>
            </value>
          </entry>
        </Map>
      </Attributes>
    </Field>
    <Field displayName="Email Address" dynamic="true" name="email" type="string">
      <Attributes>
        <Map>
          <entry key="hidden">
            <value>
              <Script>
                <Source>
                  import sailpoint.tools.Util;
 
                  if(Util.isNullOrEmpty(email)) {
                    return true;
                  }
                  return false;
                </Source>
              </Script>
            </value>
          </entry>
        </Map>
      </Attributes>
    </Field>
    <Field displayName="last_name" dynamic="true" name="lastname" type="string"/>
  </Section>
</Form>

for instance adam kennedy

Hi Sara,

Can you open the Request Item Details, it should provide more insight in the error and error message.

  • On the Identity page, goto tab Events.
  • Click on the failing Access Request (most likely the top one)
  • Click on: View Complete Details
  • On this page there is a section ‘Errors and Warnings’ at the bottom of this page

Without this it is a bit hard to directly state what the issue is :frowning:

You can also find a more detailed error in the sailpoint log-file (log4j2). At least there should be a stacktrace with more information.

– Remold

Hey Sara, have you checked the syslog? You might get some idea as to what is making this fail.

Do you mean here? those two events is not related I did those before to use the new form


this is in the log

@aishwaryagoswami thank for your answer this is from the syslog

sailpoint.tools.GeneralException: sailpoint.tools.GeneralException: The application script threw an exception: java.lang.NullPointerException: Attempt to invoke method getValue on null value BSF info: script at line: 0 column: columnNo
at sailpoint.api.DynamicValuator.evaluate(DynamicValuator.java:404)
at sailpoint.api.Formicator.expandField(Formicator.java:1065)
at sailpoint.api.Formicator.expandInner(Formicator.java:728)

its failing here

its solve it! thank you for your help guys, looking in the logs help you to trace your erros :slight_smile:

Always check for NULL values when you perform a getField or getAttribute.

Easiest check I use from String is Util.isNotNullOrEmpty:

Like:

import sailpoint.tools.Util;
..
String str = ... getField("...");;
if (Util.isNotNullOrEmpty(str)) {
...
}

– Remold

3 Likes

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