Getting “invalid parameter” while setting multilist
My code looks like this(Reading data from excel) :
while (cellIterator.hasNext())
{
Cell cell = cellIterator.next();
if (cell.getColumnIndex()== 0)
{
cellValue = dataFormatter.formatCellValue(cell);
System.out.print(cellValue + “n”);
}
else
{
cellValue2 = dataFormatter.formatCellValue(cell);
System.out.print(cellValue2 + “n”);
}
}
List<Object> myList = new ArrayList<Object>(Arrays.asList(cellValue2.split(“,”)));
System.out.println(myList);
Map params = new HashMap();
params.put(ChangeConstants.ATT_COVER_PAGE_NUMBER, cellValue);
IChange change = (IChange)m_session.getObject(IChange.OBJECT_TYPE, params);
System.out.println(“Change is :”+change.getName());
ICell changecell = change.getCell(ChangeConstants.ATT_PAGE_TWO_MULTILIST01);
IAgileList value = changecell.getAvailableValues();
Object[] objectCommList = myList.toArray();
value.setSelection(objectCommList );
changecell.setValue(value);
System.out.println(“Done”);
Reading attached excel.
Getting below mentioned error.
Exception in thread “main” Error code : 60018
Error message : Invalid parameter.
at com.agile.api.pc.Session.createError(Session.java:2039)
at com.agile.api.pc.APIObject.createError(APIObject.java:76)
at com.agile.api.pc.CascadeList.setSelection(CascadeList.java:1560)
at com.cisco.Agile.visibility_subho.main(visibility_subho.java:93)
Hi Karan,
I have shared a sample code that i implemented just now, go through it and let me know in case it works.
General flow is :
1. Take the existing value in a string.
2. Concatenate the values you want to append to string.
3. Create an Array List from the string array(obtained after splitting the string based on the regular exp. using to split. )
4. Iterate through the Array List and set the array as selection.
Regards,
Arif
Hi Arif,
Can you share your code to me also.
I am facing same issue.
my code is :-
Map parms1 = new HashMap();
parms1.clear();
parms1.put(UserConstants.ATT_GENERAL_INFO_USER_ID, “3505”);
IUser user1 =
(IUser)AgileUtility.iAgileSession.getObject(IUser.OBJECT_TYPE, parms1);
IAgileList setlist = null;
//setlist.setSelection(new Object []{“Pranod Kumar Bokil”});
try {
// Get the Subscription table
ITable tblSubscriptions =
user1.getTable(UserConstants.TABLE_ESCALATIONS);
Iterator i = tblSubscriptions.iterator();
// Stop subscribing to part 1000-02
while (i.hasNext()) {
IRow row = (IRow)i.next();
IAgileList clistt=(IAgileList)row.getValue(UserConstants.ATT_ESCALATIONS_NOTIFY_USERS);
System.out.print(“get value “+clistt.toString());
ICell cell = row.getCell(UserConstants.ATT_ESCALATIONS_NOTIFY_USERS);
System.out.print(“get value “+cell.toString());
setlist = cell.getAvailableValues();
System.out.print(“get value “+setlist.toString());
//IAgileList continent = (IAgileList)setlist.getChildNode(“Priyanka Mehta”);
setlist.setSelection(new Object[] {“Priyanka Mehta”});
System.out.print(“get value “+setlist.toString());
cell.setValue(setlist);
}
} catch (APIException ex) {
System.out.println(ex);
}
When it comes to
setlist.setSelection(new Object[] {“Priyanka Mehta”}); then throw the exception of invalid parameters.
I have read agile doc but all the steps is same in my case.
Can you help me to come out from this issue.
Thanks
Priyanka
Hi Priya,
You want to replace the existing value or you want to append to it ??
For replacing with a new value use the below code. Modify as per your business requirement:
—–Begin ——-
} catch (APIException e) {