Ahilesh01
(Ahilesh A)
July 15, 2024, 1:03pm
1
I am currently using SailPoint version 8.3P1.
We have a field named action which is type postBack and this field will have allowed values as create vendor and update vendor. If user select update vendor, then it will display another postBack field searchtype where we can select search type as search with name or search with phone number. Based on the selection and after we enter the search value it will pull up the details from target. One among the field named is updatedApplication, where it can have 3 values and we are assigning the current value from target to this field. This field is a multi-valued attribute.
If user has a value and he is trying to add one more value on that field, then we are not seeing any issue. Also, if user already had 2 value and I am trying to remove 1 value from the field then I am not facing any issue. The issue is if user has a value, and I am trying to remove all the current value then the field is refreshed. In this case the field value should be null but instead it is showing the recalculated initial value.
Can someone help us on this issue?
I’m currently trying to help Ahilesh. For context, here a snippet from the Form XML related to this updatedApplication field
<Field displayName="Select Vendor" displayType="combobox" dynamic="true" helpKey="The field will display as CompanyName - FullName - EmailAddress - PhoneNumber - Id format. Select the corresponding vendor from the list." name="selectVendor" postBack="true" required="true" type="string">
<AllowedValuesDefinition>
<Script>
<Source>
import sailpoint.tools.Util;
List allowedValues = new ArrayList();
if(getVendor instanceof List){
for(Map map:Util.safeIterable(getVendor)){
StringBuilder builder = new StringBuilder();
builder.append(map.get("companyName")).append(" - ");
builder.append(map.get("fullName")).append(" - ");
builder.append(map.get("emailAddress")).append(" - ");
builder.append(map.get("phoneNumber")).append(" - ");
builder.append(map.get("id"));
allowedValues.add(builder.toString());
}
}
return allowedValues;
</Source>
</Script>
</AllowedValuesDefinition>
<Attributes>
<Map>
<entry key="hidden">
<value>
<Script>
<Source>
if(getVendor != null @and getVendor instanceof List){
if(getVendor.size() > 0){
return false;
}
}
return true;
</Source>
</Script>
</value>
</entry>
</Map>
</Attributes>
</Field>
<Field dynamic="true" hidden="true" name="vendorDetails">
<Script>
<Includes>
<Reference class="sailpoint.object.Rule" id="0a284c4e90001672819001cbf82201c2" name="NYL - Rule - Vendor Registration"/>
</Includes>
<Source>
import sailpoint.tools.Util;
import sailpoint.tools.GeneralException;
import sailpoint.object.Custom;
if(getVendor != null @and getVendor instanceof Map){
return getVendor;
}
String id = "";
if(selectVendor != null @and !selectVendor.isEmpty() @and getVendor instanceof List){
for(Map map:Util.safeIterable(getVendor)){
if(map.get("id") != null @and selectVendor.contains(map.get("id"))){
id = map.get("id");
break;
}
}
try{
Custom customObj = context.getObjectByName(Custom.class, "NYL - Vendor Registration Details");
String path = customObj.get("path");
String jwtTokenURL = customObj.get("jwtTokenURL");
String tanantId = customObj.get("tanantId");
String serviceAccountId = customObj.get("serviceAccountId");
String accessTokenUrl = customObj.get("accessTokenUrl");
String vendorSearchStringUrl = customObj.get("getVendorByString");
String jWtToken = getJwtToken(path, jwtTokenURL, tanantId,serviceAccountId);
String accessToken = null;
if( null != jWtToken && null != accessTokenUrl)
{
accessToken = getAccessToken(jWtToken,accessTokenUrl);
}
id = "/"+id;
return getVendorsByPhoneOrId(accessToken, id, vendorSearchStringUrl);
} catch(GeneralException e){
throw e;
}
}
</Source>
</Script>
</Field>
<Field displayName="Vendor LifeCycle" displayType="Combobox" helpKey="To add new lifecycle to vendor, select the corresponding lifecycle from the drop down. To remove the existing lifecycle, deselect the corresponding lifecycle from the list." multi="true" name="updatedApplication" type="string">
<AllowedValuesDefinition>
<Script>
<Source>
import java.util.List;
List list = new ArrayList();
list.add("Tech");
list.add("QA");
list.add("Prod");
return list;
</Source>
</Script>
</AllowedValuesDefinition>
<Script>
<Includes>
<Reference class="sailpoint.object.Rule" id="0a284c4e90001672819001cbf82201c2" name="NYL - Rule - Vendor Registration"/>
</Includes>
<Source>
import sailpoint.tools.Util;
import sailpoint.tools.GeneralException;
import sailpoint.object.Field;
import java.util.List;
import java.util.Map;
import java.util.ArrayList;
import org.apache.log4j.Logger;
Logger customLog = Logger.getLogger("Form.NYLVendorRegistration");
Map customMap = getKeyFromCustom();
List fieldList = new ArrayList();
if(vendorDetails != null @and vendorDetails.get("applications") != null @and customMap != null){
List valueList = new ArrayList();
List applicationList = vendorDetails.get("applications");
for(Map map : Util.safeIterable(applicationList)){
String appId = map.get("applicationId");
for(Map.Entry entry : customMap.entrySet()){
if(entry.getValue().equals(appId)){
//appId = appId.replace("ApplicationID", "");
fieldList.add(entry.getKey().replace("ApplicationID", ""));
}
}
}
}
return fieldList;
</Source>
</Script>
</Field>
system
(system)
Closed
September 13, 2024, 2:13pm
3
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.