Inactivating a List Value

I’m having a hard time inactivating a list value and get far with the Agile API guide and this site, so I’m hoping someone else knows who could help.  To put it simply, given the Simple List and the values to inactivate, set list children to Inactive.

//I can get the list like so:
IAdmin admin = session.getAdminInstance();
IListLibrary listLib = admin.getListLibrary();
IAdminList list = listLib.getAdminList(“Selection List for 28760”)

//I can add a list value called ‘Pluto’ just fine
IAgileList listchildren = list.getValues()
listchildren.addChild(“Pluto”, “APInamePluto”)

//but then trying to inactivate  it, nothing happens:

Does anyone know what I am missing?

No Files Were Attached
Matt Paulhus Agile Angel Asked on February 15, 2018 in Other APIs.
Add Comment
5 Answer(s)

You can Interact with the agile list properties only wrapping it as AdminList:
IAdminList adminList = list.getAdminList();

the setObsolete is valid only if you try to inactivate a single list entry (the same interface) like “Pluto” and cannot be used to the entire list

Antonio Agile Angel Answered on February 16, 2018.
Add Comment

Oh, I am referring to inactivate a specific list value. I was already able to inactivate an entire list, but am struggling to inactivate a particular list value via API. 
For instance, say I was going to inactivate a list value called “Neptune”, found in the adminList, how would I go about doing that?  I’ve had little success even after following the API user guide.

Namely, this does not work:
IAdminList list = listLib.getAdminList(“Selection List for 28760”)
IAgileList listchildren = list.getValues()

Matt Paulhus Agile Angel Answered on February 16, 2018.
Add Comment

Sorry I though the opposite.
If you call addChild, you are not pointing on the just added element but on the list itself. So the setObsolete is called on the list itself in your code (and therefore doesn’t work)
For that it is quite easy. When you call list.addChild(“Neptune”) the API returns the just added value (an IAgileList …). So you have to call setObsolete on this new one and not on the original list.

IAgileList neptune = (IAgileList) listchildren.addChild(“Neptune”)

If any question you can check the sdk docs where this is explained quite well:


Antonio Agile Angel Answered on February 17, 2018.
Add Comment

Hi Matt,
Please try the below code. It sets all the list values to inactive.

IAdmin admin=session.getAdminInstance();

IListLibrary listLibrary=admin.getListLibrary();
IAdminList adminlist = listLibrary.getAdminList(“Product Line”);
IAgileList values = adminlist.getValues();
IAgileList[] arr=(IAgileList[]) values.getChildren();

for(int i=0;i

karthik Agile User Answered on February 19, 2018.

for(int i=0;i

on February 19, 2018.


on February 19, 2018.
Add Comment
Best answer

Thank you Karthik and Antonio.
It looks like I eventually got it. Antonio is partially incorrect as the way to set a list value to Inactive because rather it is quite similar to how you would add a new list value.
Borrowing from what Karthik wrote, I experimented and got this to finally work, though I didn’t see your last comment until just now. 

IAgileList listchildren = list.getValues()
IAgileList[] arr =(IAgileList[]) listchildren.getChildren();

arr.each{ listentry ->
   if (value == “Neptune”) {
   listentry.setObsolete(true)  }

listchildren.addChild(listentry) }


Matt Paulhus Agile Angel Answered on February 19, 2018.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.