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

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

    Re: getting the unreserved Items

    ‏2012-09-28T04:33:58Z  
    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 
    } 
    }
    
  • Rocky_01
    Rocky_01
    32 Posts

    Re: getting the unreserved Items

    ‏2012-09-28T11:01:50Z  
    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)
    <pre class="jive-pre"> 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 } } </pre>
    Hi Alex,

    Thanks a lot for

    -Rocky