Anonymous_User Absent Member.
Absent Member.
1384 views

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.
Labels (1)
0 Likes
1 Reply
Anonymous_User Absent Member.
Absent Member.

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.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.