Home

Results 1 to 2 of 2

Thread: More grief with ContainerItem.Contacts...

  1. #1
    Sean Kirkby NNTP User

    More grief with ContainerItem.Contacts...

    I have created a product that deals with tasks in the GW calendar.

    It also makes use of item contacts.

    The product retrieves the contact item for each contact ID in each task, and then lists the name and contact information for each of the contacts.

    However, if such a contact is in a shared address book that the user doesn't own, I get an error using the contact ID from the Task.Contacts list to retrieve the contact:

    Status.Code = 53511
    Status.Description = "Record not found"

    Should I be able to retrieve a contact from a shared address book using the contact's ID as stored in a Task.Contacts list?

    Thanks.

    --sk.

  2. #2
    Preston Stephenson NNTP User

    Re: More grief with ContainerItem.Contacts...

    I've put in a fix.

    When you get back the id for the contact,
    you don't know what container (book) the item is in.
    You can pass "books" as the container in getItemsRequest
    and the id of the contact in an <item> element in the <items>
    element.
    Before, if the contact was in the user's database, we would
    return the item. If the contact was in a PAB shared with
    the user, we couldn't find the contact.

    The fix is to also search in the PAB's shared with the user.
    The one caveat is that you can only pass one <item> element.

    The fix will be in the next major release.

    Here is a quick test:
    public void testGetContact() {
    ContactRefList list = null;
    GetItemResponse resp = null;
    GetItemsResponse iresp = null;
    ItemRefList items = new ItemRefList();
    Task task;
    String[] contact = new String[1];
    try {
    resp = m_main.getService().getItemRequest( m_mitem.getId(), null,
    m_main.getSessionId(), m_main.getTrace() );
    if ( null != resp && null != resp.getStatus() && 0 !=
    resp.getStatus().getCode() ) {
    m_main.displayError( resp.getStatus(), "testGetContact" );
    return;
    }
    task = (Task)resp.getItem();
    list = task.getContacts();

    contact[0] = list.getContact()[0];
    items.setItem( contact );
    iresp = m_main.getService().getItemsRequest( "books", null, null,
    items, 0, m_main.getSessionId(), m_main.getTrace() );

    } catch ( Exception e ) {
    e.printStackTrace();
    }
    }


    Let me know if you have questions.
    Preston

    >>> On Monday, June 29, 2009 at 9:22 PM, Sean

    Kirkby<skirkby@armordatasystems.com>
    wrote:
    > I have created a product that deals with tasks in the GW calendar.
    >
    > It also makes use of item contacts.
    >
    > The product retrieves the contact item for each contact ID in each task,

    and
    > then lists the name and contact information for each of the contacts.
    >
    > However, if such a contact is in a shared address book that the user

    doesn't
    > own, I get an error using the contact ID from the Task.Contacts list to
    > retrieve the contact:
    >
    > Status.Code = 53511
    > Status.Description = "Record not found"
    >
    > Should I be able to retrieve a contact from a shared address book using

    the
    > contact's ID as stored in a Task.Contacts list?
    >
    > Thanks.
    >
    > ‑‑sk.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •