[E2010][EWS] How to retrieve calendar items of a defined category?

Hi,
I'm trying with VBScript to retrieve calendar items of a mailbox for a category.
I managed with EWS to retrieve ALL the calendar items of a mailbox :
const TARGETURL="https://.../ews/exchange.asmx"
const USERNAME="username"
const PASSWORD="pasword"
Const strEmailAddress = "[email protected]"
Dim objXmlHttp, xmlDoc
Set objXmlHttp = CreateObject("Microsoft.XMLHTTP")
Set objXmlDoc = CreateObject("MSXML2.DOMDocument")
'XML request
strXmlData = ""
strXmlData = strXmlData & "<?xml version=""1.0"" encoding=""utf-8""?> "
strXmlData = strXmlData & "<soap:Envelope xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"" "
strXmlData = strXmlData & " xmlns:t=""http://schemas.microsoft.com/exchange/services/2006/types""> "
strXmlData = strXmlData & " <soap:Body> "
strXmlData = strXmlData & " <FindItem xmlns=""http://schemas.microsoft.com/exchange/services/2006/messages"" "
strXmlData = strXmlData & " xmlns:t=""http://schemas.microsoft.com/exchange/services/2006/types"" "
strXmlData = strXmlData & " Traversal=""Shallow""> "
strXmlData = strXmlData & " <ItemShape> "
strXmlData = strXmlData & " <t:BaseShape>AllProperties</t:BaseShape> "
strXmlData = strXmlData & " </ItemShape> "
strXmlData = strXmlData & " <CalendarView StartDate=""2014-01-20T13:00:00"" EndDate=""2014-01-30T23:59:59""/>"
strXmlData = strXmlData & " <ParentFolderIds> "
strXmlData = strXmlData & " <t:DistinguishedFolderId Id=""calendar""> "
strXmlData = strXmlData & " <t:Mailbox><t:EmailAddress>" & strEmailAddress & "</t:EmailAddress></t:Mailbox> "
strXmlData = strXmlData & " </t:DistinguishedFolderId> "
strXmlData = strXmlData & " </ParentFolderIds> "
strXmlData = strXmlData & " </FindItem> "
strXmlData = strXmlData & " </soap:Body> "
strXmlData = strXmlData & "</soap:Envelope> "
objXmlHttp.open "POST", TARGETURL, False, USERNAME, PASSWORD
objXmlHttp.setRequestHeader "Content-Type", "text/xml"
objXmlHttp.send strXmlData
'status 200
If objXmlHttp.Status = "200" Then
If objXmlDoc.loadXML(objXmlHttp.responseText) Then
Set soap_Body = objXmlDoc.documentElement.childNodes.item(1)
Set m_FindItemResponse = soap_Body.childNodes.item(0)
Set m_ResponseMessages = m_FindItemResponse.childNodes.item(0)
Set m_FindItemResponseMessage = m_ResponseMessages.childNodes.item(0)
Set m_RootFolder = m_FindItemResponseMessage.childNodes.item(1)
Set t_Items = m_RootFolder.childNodes.item(0)
For Each calendarItem In t_Items.childNodes
Dim t_Subject
t_Subject = calendarItem.getElementsByTagName("t:Subject").item(0).text
msgbox t_Subject 'Show the subject of the item
Next
End If
Else
wscript.echo "Error: " & objXmlHttp.Status & " - " & objXmlHttp.statusText
End If
But now I would like to add a filter in the XML code to retrieve only the calendar items of a category called "TEST".
How can I do this please?
Thanks

>> Do you have an example with ItemView to add a filter for a category? I didn't manage to make the query.
Firstly I would suggest you use Powershell and the EWS Managed API, this will save you hours of work and many many lines of code.
Because the category field is a multivalued property the best way to query this is to use a AQS query string the SOAP would look like
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<t:RequestServerVersion Version="Exchange2010_SP2" />
</soap:Header>
<soap:Body>
<m:FindItem Traversal="Shallow">
<m:ItemShape>
<t:BaseShape>AllProperties</t:BaseShape>
</m:ItemShape>
<m:IndexedPageItemView MaxEntriesReturned="1000" Offset="0" BasePoint="Beginning" />
<m:ParentFolderIds>
<t:DistinguishedFolderId Id="calendar" />
</m:ParentFolderIds>
<m:QueryString>System.Category:'Green Category'</m:QueryString>
</m:FindItem>
</soap:Body>
</soap:Envelope>
Because this is a 2010 feature versioning you request is critical.
Cheers
Glen

Similar Messages

  • How to retrieve the item text from VL03 transaction .

    How to retrieve the item text from VL03 transaction .
    The requirement is like this, the item text thus retrieved should be printed in the script under the item.

    Jagadieshwar,
    Use <b>READ_TEXT</b> function module to get the proper item text of Delivery.
    <b>ID</b>: Probably you want 0002 (Item Note), but it depends which text you want Item Note, Material Sales Text ,etc..
    <b>NAME</b>: CONCATENATE Delivery Doc. Number + Delivery Item Number (e.g. 0080001729000010)
    <b>OBJECT</b>: VBBP
    <b>
    LANGUAGE</b>: sy-langu or whatever you want.

  • How to restore calendar items from Entourage 2008 after upgrade to Lion (10.7.5)?

    I held off upgrading to Lion because I had a bunch of old email I wanted to convert first. But now that Apple is no longer offering security updates for Snow Leopard, I decided to take the plunge. Unfortunately, after the Lion upgrade most of my calendar items in Entourage 2008 disappeared (and those that remained appeared in duplicate).
    I think I should be able to access an uncorrupted version of my Main Identity folder for Office 2008 … because I have an Automator workflow that creates a daily backup, and that backup should be available through Time Machine. I turned off Time Machine after this calamity so that I wouldn't overwrite my Entourage Backup folder.
    I need the July 8 or 9 version of:  ~ / Documents / Entourage Backup / Main Identity.
    But when I select the Entourage Backup folder and open Time Machine, all the Finder windows behind the current one go dark and I can't move backward toward an earlier date (I've done this with Time Machine turned off and on). This makes me think the Entourage Backup folder has not been getting backed up recently, or perhaps ever. Ugh.
    When I check my Time Machine preferences, only the following items are shown as excluded from backups:
    So it seems I should be in the clear and able to access Entourage Backup.
    Any idea what I'm doing wrong in trying to restore from Time Machine? Or anything else I might be doing wrong?
    Many thanks.

    When I check my Time Machine preferences, only the following items are shown as excluded from backups:
    Not sure how any of this relates to a Time Capsule....one of the hardware products that we support in this forum.....but we will try to help.
    Main Identity is located as follows on your Mac:
    Macintosh HD > Documents > Microsoft User Data > Office 2008 Identities > Main Indentity
    Unfortunately, you have been excluding Microsoft User Data from your backups, so there is nothing to recover or restore.

  • How to copy calendar item to other calendar ?

    I have a shared calendar with events in...but I also want to have SOME private calendar items (in another calender) viewable in the shared calendar. I guess I have to copy those to the shared calender but how is this done ?

    I know it would be confusing, but I am sharing 1 calendar with someone, and another with someone else...
    They don't need to see everything in both calendars so i wanted to "mark" an item for example for 2 calendars.

  • Nokia X6 - retrieve calendar items

    Hello there,
    My Nokia X6-00 is practically 'dead'.
    I can't restart my phone or it wont last long for the phone to give up.
    Is there a way to retrieve my agenda items which are stored on the phone?
    I don't use outlook on my pc and I also can't sync the calendar items.
    Can I search for a file in the windows explorer (something like a *.pst file used in mailprograms).
    Thank you so much for helping me with this!
    regards,
    Rebellushy

    Set up your phone to sync calendar to a calendar app on your computer. Connect the phone to the computer, click on its name in iTunes on the left, then click on the Info tab on the right. Scroll down if necessary to Calendars, check to sync and choose a calendar application such as Outlook on Windows or iCal on a Mac. Make sure there is at least one entry in that app on your computer, then click the Sync button in iTunes.

  • How To Retrieve an Object's Value Defined Using c:set ... Tag?

    I have the value of a variable defined in JSP#1 (JSP#1 is not a form) using JSTL tag:
       <c:set var="id" value="${articleForm.article}" scope="session"/>Now, I have an object 'id' in the session scope. The object 'id' and all the information, which are defined in JSP#1, are forwarded to JSP#2.
    JSP#2 is a form. But, the 'id' is not used in JSP#2.
    JSP#2 has a submit button and then, a servlet takes over the control after that button is clicked. All the text fields in JSP#2 together with the object 'id' are forwarded to this servlet.
    I have two questions:
    1. I should put this object 'id' in a request scope or a session scope? Currently, it is in a session scope.
    2. How to retrieve the value of this object 'id' in this servlet? (I do not want to print the value out. I want to retrieve the value and store it in a database.)
        int articleID = Integer.parseInt( session.getAttribute( "id" ) );   or, it should be retrieved in another way?

    I'm not sure you understand the concept of a session object.
    Java objects stay on the server. There is no transmission between the web browser and the client.
    The scope just sets how long the server "remembers" that variable.
    request scope - only lasts one request. Once a web page is returned to the client, the server forgets all request variables.
    session scope - lasts for one user - across multiple requests/web pages.
    1. I should put this object 'id' in a request scope or a session scope? Currently, it is in a session scope.From your description, you appear to have it right - your object should be in session scope.
    2. How to retrieve the value of this object 'id' in this servlet? (I do not want to print the value out. I want to retrieve the value and store it in a database.)If articleForm.article is an String then that looks the right way to access it.
    You might have to do it like this:
    int articleID = Integer.parseInt( (String)session.getAttribute("id"));
    The Integer.parseInt method takes a String as a parameter - while session.getAttribute() returns an Object.
    This code will work if the object stored in the session is a String.
    The object stored in the session is ${articleForm.article} What type does articletForm.getArticle() return? That is the type you need to cast it to when retrieving it from the session.
    Cheers,
    evnafets

  • TS1702 How to retrieve calendar events

    I lost all my past events on my phone - is there a way to retrieve them?

    Hello there Mkleczkowska,
    The way that I would recommend getting the calendar events back is through an iTunes restore if you have synced and backed up the phone to iTunes recently.
    iOS: How to back up and restore your content
    http://support.apple.com/kb/ht1766.
    Follow the directions for the version of the Operating System you have on your computer.
    Regards,
    Sterling

  • How to retrieve deleted items?

    I have Tungsten E2 on WinXP Home.
    When I delete items on my handheld, I check the option "Save archive copy on PC".
    How can I view what has been previously ?
    If I use File > Open Archive, there are no files to open.
    If I use Windows Explorer, the "Archive" folder is empty.
    Post relates to: Tungsten E2

    When you open the palm desktop program on your computer, make sure you are clicking on the icon of the item you wish to retrieve. For example, if you want to get back your contact information, first make sure you click on the contact icon on the left side and then click on File > Open Archive.
    Now, are you able to find the missing files?
    Post relates to: Tungsten E2

  • How to retrieve selected item details (Product Id, Quantity) in Action clas

    Hi
    I want to retrieve the selected item details (Product Id, Quantity) in my custom action class .I am calling custom action event after u2018add to cartu2019 button clicked.  I basically need these details to pass to custom BAPI. I can able to retrieve User Name and itemkey successfully.  I Tried to retrieve the product , productID using WebCatItem but I was getting run time error and when I debug the code I can see webCatItem coming  as null. Below is my code. 
    public class Z_AddToBasketAction extends BaseAction {
         /* (non-Javadoc)
    @see com.sap.isa.core.BaseAction#doPerform(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
         public ActionForward doPerform(
              ActionMapping mapping,
              ActionForm form,
              HttpServletRequest request,
              HttpServletResponse response)
              throws IOException, ServletException {
              //Cache.Access access = null;
              Map returnValues = null;
              UserSessionData userSessionData =
                   UserSessionData.getUserSessionData(request.getSession());
                   BusinessObjectManager bom =
                             (BusinessObjectManager) userSessionData.
                             getBOM(BusinessObjectManager.ISACORE_BOM);
         String selectedPartnerID = bom.getUser().getUserId();
         String strItemkey=request.getParameter("itemkey");
         WebCatItem webCatItem =     (WebCatItem) request.getAttribute(
                             com.sap.isa.catalog.actions.ActionConstants.RA_WEBCATITEM);
         //If you are looking at Product attributes.
          String att =  webCatItem.getProduct()", "webCatItem.getProductID();
         ZBOM mybom = (ZBOM) userSessionData.getBOM(ZBOM.ZCUSTOM_BOM);
         return mapping.findForward("success");
    Please help
    Thanks
    Aravind
    Edited by: Aravinda Boyapati on Nov 30, 2010 10:21 PM

    Hi Arvinda,
    From which page you are trying to add products in cart? Are you selecting only 1 item at a time and then click on Add to cart button or you select more then 1 items to add into cart.
    You can ceate hidden input filed and set their value through java script when you select any item. If more then 1 items then you can create an arry and set in the request parameter and then retrieve it in your custome class.
    Regards.
    eCommerce Developer.

  • How to retrieve line Item values from an object using groovy

    def RevenueObject = nvl(ChildRevenue,0);
    println('revenueItems==='+revenueItems.size());
    while(RevenueObject.hasNext())
    def revenueLine = RevenueObject.next();
    revenueLine.setAttribute('Test_c', 'Hello');
    } Groovy Scripting
    Error : Getting null value for Revenue object
    Exception in expression "OpportunityEO" trigger "getRevenueItems" : groovy.lang.MissingMethodException : No signature of method: oracle.jbo.server.ViewRowSetIteratorImpl.size() is applicable for argument types: () values: [] Possible solutions: is(java.lang.Object), find(), use([Ljava.lang.Object;), with(groovy.lang.Closure), sleep(long), find(groovy.lang.Closure)
    at "OpportunityEO" trigger "getRevenueItems" line 7
    No signature of method: oracle.jbo.server.ViewRowSetIteratorImpl.size() is applicable for argument types: () values: [] Possible solutions: is(java.lang.Object), find(), use([Ljava.lang.Object;), with(groovy.lang.Closure), sleep(long), find(groovy.lang.Closure)

    Depending on the message the line number might be in one of the fields:
    MESSAGE_V1
    MESSAGE_V2
    MESSAGE_V3
    MESSAGE_V4
    Although if the message simply is not meant to include the line number, it won't be there. That's the way it is. If there is a user exit available, you may add your custom messages with the line number. In some user exits (in sales order for sure) there is a special variable (flag), which is set when the BAPI runs the transaction.

  • How to assign a item to User Defined Attribute group?

    I have created a new User Defined Attribute(UDA) using PIM- setup responsiblity.
    But i don't know how to assign one newly created item to the UDA.
    Please help me out.
    Thanks in advance.

    hai Naren and Ganesh,
    i have few queries in wad can u help me in resolving the problems?
    i have generated a query using variables ,but when i am executing that query in web ,i am not getting any pop up asking fr variable.so wht might b the error.
    first i have selected the table in wad and assigned the dataprovider ie is query,
    in tht query a variable is also existed but i am not getting any pop up
    is there any radio button / check boexes to select and assign the variable
    so plz help me in this aspect..
    if u r working on wad can plz send me u r contact mail id so tht i can interact easily...my mailid is [email protected] ok
    regards
    Suri../

  • How to retrieve sharepoint list data and show it on excel-addin using C#

    Hi,
    we have a sharepoint list where all students are present. we wanted to get the data from the list and show it via excel addin (VSTO) (something like save,retrieve buutons) . we have some more business logic which need to be performed before the data is retrieved
    . once data is shown on excel , user modifies it and update/save the record back to sharepoint.
    can you please give some samples and suggest any links to start with development.
    Thanks
    chaitu

    Hi chaituatp,
    For this requirement, I would suggest you to get familiar with how to create VSTO applications, and how SharePoint object model works. Here are some sample code about this:
    How to: Retrieve List Items using JavaScript:
    http://msdn.microsoft.com/en-us/library/hh185007(v=office.14).aspx
    http://msdn.microsoft.com/en-us/library/office/ee534956(v=office.14).aspx
    VSTO application show data in datagridview:
    http://stackoverflow.com/questions/16926275/simple-example-of-vsto-excel-using-a-worksheet-as-a-datasource
    Thanks,
    Qiao
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Qiao Wei
    TechNet Community Support

  • Switched carriers and now i don't have exchange server calendar items - does anyone know how to retrieve them

    recently transfered from AT&T to Verizon iphone 4s and when I did the syn everything came over to new device except exchange calendar items.  Any idea how to get them synced.  I 've lost them from the computer as well.

    This has nothing to do with switching carriers and the syncing of calendar events over the air with an Exchange server has nothing to do with the iTunes sync process.
    On the iPhone go to Settings > Mail, Contacts, Calendars.
    Select the Exchange account.
    Is Calendars turned on for over the air syncing?

  • On my iPad 3, how do I make calendar items lasting more than one day appear as such on the monthly view of my calendar? Right now only the first day of the item appears.

    On iPad 3, all of my calendar items lasting more than one day do not appear correctly when looking at the monthly view of the calendar; only the first day of the appointment appears. For example, if I am taking a vacation for 4 days, only the first day of the vacation is marked on the calendar, instead of being listed on all 4 days. When I look at the weekly view, however, it is correct and is listed on all 4 days. The problem here of course is that at a glance, there is no way to look at my monthly schedule. On my iPhone, everything is correct, regardless of month or week view, so clearly this is an iPad problem I guess? Please advise on how this can be corrected. Thank you!

    Unfortunately you can't do what you want. Many people have complained to Apple about this. I suggest you provide Apple feedback directly at http://www.apple.com/feedback/macosx.html. They will not provide a direct response but hopefully if enough people provide feedback Apple will fix this.

  • How to transfer a calendar items from one month to another

    How can one transfer a calendar item from one month to another month by drag and drop.

    Click it and hold, then drag. If you want to duplicate it, hold down the option/alt key while dragging.

Maybe you are looking for

  • Can not boot from OSX disc

    I recently partitioned my internal drive with an 80 gig partition to run Ubuntu , removed Ubuntu and now can not resize hd to recover the 80 gig that I used , there was a program with this Ubuntu install called rEFIt that was installed for the dual b

  • Is this HD compatible with my 'puter?

    Hey all! In the spirit of absolute paranoia, is this drive compatible with my Power Mac G5 2.0GHzer? I won't be setting it up in a RAID, just another drive to throw stuff on. Thanks a bunch in advance! Michael

  • New computer with external hard drive...

    Current setup has iTunes Library, all files, located on an external hard drive....I'm going to implement a new laptop shortly, and will download the latest version on iTunes when I set it up..... I'll have the destination for music point to that exte

  • HOW TO : Initialize / On Load of a BPM Object Presentation

    Hi, We have a BPM Object Presentation. On Load of the same, we need to enable/disable a UI field basing on data of one of the BPM Object attributes. If we put it in constructor, it is not allowing to enable/disable the Presentation UI Component as it

  • IPhoto 11 opens but freezes as soon as I select photos; reinstalled no change

    iPhoto 11 (9.1.5) started freezing. The appln opens, all seems OK. When I select photos or categories: events, last import etc. I reinstalled with no change.