Help, How to use POOM ItemId and Restrict method?

  • Thread starter Thread starter Batterhead
  • Start date Start date
B

Batterhead

hi there,

i use c# and want to locate an appointment item in the appointment
collection. i tried different ways but it keeps reporting "The query
string is incorrectly formatted.". below is what i have tried, any
idea? thanks.

string ArgsItemId = "1073741828";
AppointmentCollection acApptColn =
olsSession.Appointments.Items.Restrict("[ItemId] = " + ArgsItemId);
AppointmentCollection acApptColn =
olsSession.Appointments.Items.Restrict("[ItemId] = \"" + ArgsItemId +
"\"");
AppointmentCollection acApptColn =
olsSession.Appointments.Items.Restrict("[ItemId] = '" + ArgsItemId +
"'");
AppointmentCollection acApptColn =
olsSession.Appointments.Items.Restrict("[ItemId] = " +
Convert.ToInt32(ArgsItemId));

batterheadccw
 
ItemId is a class in the managed libraries to abstract the POOM OID and MAPI
ENTRYID values. Replace with [Oid] in your query and it will work. However,
if as it seems you want to retrieve a single item by Oid you'd be better off
using the Appointment constructor which accepts an ItemId e.g.

Appointment a = new Appointment(new ItemId(1073741828));

Peter
 
Back
Top