Provisioning rule, not store last name correctly

Dear community
I trying to update an identity

But after i save it I dont see that change neither in iiq or in the target db

This is the form

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Form PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Form name="Edit-Identity-Form-Base" type="UpdateIdentity">
    <Attributes>
        <Map>
            <entry key="pageTitle" value="Edit-Identity-Form-Base"/>
        </Map>
    </Attributes>
    <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>
        <!--Display lastname and firstname if exist before, only read, this field has to come before the lastname below, because below is required-->
        <Field columnSpan="1" dependencies="lastname,firstname" displayName="Last Name" dynamic="true" name="lastname" readOnly="true" 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 displayNameNew = firstname + " " + lastname;

                                        if(Util.isNullOrEmpty(lastname) || Util.isNullOrEmpty(firstname)) {
                                            field.setValue("");
                                            return false;
                                        }


                                        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 columnSpan="1" displayName="Display Name" dynamic="true" name="displayName" postBack="true" type="string"/>
        <Field columnSpan="1" displayName="last_name" dynamic="true" name="lastname" postBack="true" required="true" 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.getLastname());
                                            }
                                        }
                                        return false;
                                </Source>
                            </Script>
                        </value>
                    </entry>
                </Map>
            </Attributes>
        </Field>
        <Field columnSpan="1" displayName="first_name" dynamic="true" name="firstname" postBack="true" required="true" type="string"/>
    </Section>
</Form>

iiq
image

time tracking
image

But i change lastName to “La Rotonda”

This the code for update an identity

 //UPDATE Operation
                        else if (AccountRequest.Operation.Modify.equals(accountRequest.getOperation())) {

                            // MODIFY Operation, update
                            System.out.println("Account Request Operation = Modify - Update Identity");

                            String lastName = getAttributeRequestValue(accountRequest,"lastname");
                            if(lastName != null){
                                PreparedStatement statement = connection.prepareStatement("update users set lastname = ? where id = ?");
                                statement.setString(2, (String) accountRequest.getNativeIdentity());
                                statement.setString(1, lastName);
                                statement.executeUpdate();
                            }

                            String firstName = getAttributeRequestValue(accountRequest,"firstname");
                            if(firstName != null){
                                PreparedStatement statement = connection.prepareStatement("update users set firstname = ? where id = ?");
                                statement.setString(2, (String) accountRequest.getNativeIdentity());
                                statement.setString(1, firstName);
                                statement.executeUpdate();
                            }
                        }
1 Like

check in My work → Workitems if any Workitem is waiting for approval.

1 Like

nothing here

1 Like


1 Like

You updated lastname for a user using OOTB Edit Identity. You see that change in IdenityIQ ?

You are expecting the last name to be sync to your Target application (Some DB) ?

2 Likes

You have 2 fields named “lastname”. Is this causing the error?

1 Like

You were right removing the extra lastname read only solve the issue

2 Likes

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