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
time tracking
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();
}
}