Topic
2 replies Latest Post - ‏2012-09-28T11:01:50Z by Rocky_01
Rocky_01
Rocky_01
32 Posts
ACCEPTED ANSWER

Pinned topic getting the unreserved Items

‏2012-09-27T17:58:10Z |
Hi,

i am using the following query for getting the Items used by a specific user:

select item from collaboration_area('CollArea') where item.step.reserved_by = 'UserName' and item.step.path = 'StepPath'

But how can we get the Items not reserved by a specific user??

Thanks,
Rocky
Updated on 2012-09-28T11:01:50Z at 2012-09-28T11:01:50Z by Rocky_01
  • SystemAdmin
    SystemAdmin
    648 Posts
    ACCEPTED ANSWER

    Re: getting the unreserved Items

    ‏2012-09-28T04:33:58Z  in response to Rocky_01
    Hi Rocky!

    Sorry, but you can't do that by design. You can search all items in a step and then check everyone if one is not reserved via function isEntryReservedInStep(item, step)
    
    var colareaName = 
    "Обработка запроса на создание записи (Точмаш)"; var colarea = getColAreaByName(colareaName); var queryString = 
    "select item,item.step.path  from collaboration_area ('"+colareaName+
    "') where item.step.path = 'Уточнение'"; var searchquery = 
    
    new SearchQuery(queryString); var items = searchquery.execute(); 
    
    while(items.next()) 
    { var item = items.getItem(1); var step = items.getString(2); 
    
    if(!colarea.isEntryReservedInStep(item, step)) 
    { your logic here 
    } 
    }