.NET Components for Mobility

Contact Properites

Last post 05-08-2008 4:16 PM by PeterFoot. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 05-04-2008 6:58 AM

    • dano
    • Top 25 Contributor
    • Joined on 03-17-2008
    • Posts 13

    Contact Properites

    With the 3.1 version certain properties of the Contact object don't work like IMAddress1 and JobTitle.  So this code would fail.

                OutlookSession s = new OutlookSession();
                Contact c = (Contact)s.Contacts.Items[0];
                c.JobTitle = "asdf";
                if(c.JobTitle !="asdf")      
                   throw new Exception("value not set")         

     With the 3.2 version none of the properties that I tested (eg.  BusinessTelephoneNumber, Email2Address)seem to hold their values?   Help!

    Filed under:
  • 05-04-2008 11:03 AM In reply to

    Re: Contact Properites

    There are some properties which are only supported on Windows Mobile 5.0 and above and would not have any effect on WM2003 devices. Also you must call the Update() method to save changes on a PIM item, e.g.

    c.JobTitle = "asdf";

    c.Update();

     

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 05-04-2008 4:21 PM In reply to

    • dano
    • Top 25 Contributor
    • Joined on 03-17-2008
    • Posts 13

    Re: Contact Properites

    Tried this on both WM5 and WM6 devices.  No luck.   

                 OutlookSession s = new OutlookSession();
                Contact c = (Contact)s.Contacts.Items[0];
                c.JobTitle = "asdf";
                if (c.JobTitle != "asdf")
                    MessageBox.Show("Didn't stick1");
                c.Update();

                if (c.JobTitle != "asdf")
                    MessageBox.Show("Didn't stick2");
                OutlookSession s1 = new OutlookSession();
                Contact c1 = (Contact)s1.Contacts.Items[0];
                c1.JobTitle = "asdf";
                if (c1.JobTitle != "asdf")
                    MessageBox.Show("Didn't stick3");
                c1.Update();

                if (c1.JobTitle != "asdf")
                    MessageBox.Show("Didn't stick4");

  • 05-04-2008 4:32 PM In reply to

    • dano
    • Top 25 Contributor
    • Joined on 03-17-2008
    • Posts 13

    Re: Contact Properites

    It looks like the MS library works for this property.  When running the below on both WM5 and 6, I see the first 2 messageboxes but not 3 or 4.  Please Help!!!

                InTheHand.WindowsMobile.PocketOutlook.OutlookSession s = new InTheHand.WindowsMobile.PocketOutlook.OutlookSession();
                InTheHand.WindowsMobile.PocketOutlook.Contact c = (InTheHand.WindowsMobile.PocketOutlook.Contact)s.Contacts.Items[0];
                c.JobTitle = "asdf";
                if (c.JobTitle != "asdf")
                    MessageBox.Show("Didn't stick1");
                c.Update();

                if (c.JobTitle != "asdf")
                    MessageBox.Show("Didn't stick2");

                Microsoft.WindowsMobile.PocketOutlook.OutlookSession s1 = new Microsoft.WindowsMobile.PocketOutlook.OutlookSession();
                Microsoft.WindowsMobile.PocketOutlook.Contact c1 = (Microsoft.WindowsMobile.PocketOutlook.Contact)s1.Contacts.Items[0];
                c1.JobTitle = "asdf";
                if (c1.JobTitle != "asdf")
                    MessageBox.Show("Didn't stick3");
                c1.Update();

                if (c1.JobTitle != "asdf")
                    MessageBox.Show("Didn't stick4");

  • 05-04-2008 5:19 PM In reply to

    Re: Contact Properites

    Some additional information - with InTheHand 3.1 on WM5 only a small number of contact properties do not "stick".   Most of the contact properties such as FirstName, LastName and Email1Address work as expected.  It is just a few like IM#Address, JobTitle, and Manager that cannot be retrieved from the contact via InTheHand - either right after they are set, or if they have a value in native Outlook. 

    It does appear that the values in these properties are being set via InTheHand, because the values can be seen in the native Contacts application.  The issue seems to be in retrieving the values via InTheHand for a subset of Contacts properties.

    Barbara B.
    Filed under:
  • 05-07-2008 10:38 AM In reply to

    Re: Contact Properites

    There are two sets of properties, there are those which have been standard to Pocket Outlok from the first versions, and those (such as the IM addresses) which were added in WM5.0 through the PimPropertySet. I'm looking into why Update is not affecting those newer properties or what other caching is taking place.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 05-08-2008 8:23 AM In reply to

    Re: Contact Properites

    In your test code you will never see the second set of tests fail because the code selects the same Contact item and by that time Update was called already and a fresh Contact was created pointing to that record. I've tested the code on a couple of WM5 and WM6 devices and have not been able to duplicate the problem - each returns the value as set. What specific WM5 platform are you targetting - Smartphone or Pocket PC and do you know the AKU release version?

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 05-08-2008 9:52 AM In reply to

    • dano
    • Top 25 Contributor
    • Joined on 03-17-2008
    • Posts 13

    Re: Contact Properites

    Aha!! You are correct, I have a flawed test.  But I see the same result(I get "Didn't stick1" and "Didn't stick2") if I change the code like:

                 InTheHand.WindowsMobile.PocketOutlook.OutlookSession s = new InTheHand.WindowsMobile.PocketOutlook.OutlookSession();
                InTheHand.WindowsMobile.PocketOutlook.Contact c = (InTheHand.WindowsMobile.PocketOutlook.Contact)s.Contacts.Items[0];
                c.JobTitle = "test1";
                if (c.JobTitle != "test1")
                    MessageBox.Show("Didn't stick1");
                c.Update();

                if (c.JobTitle != "test1")
                    MessageBox.Show("Didn't stick2");

                Microsoft.WindowsMobile.PocketOutlook.OutlookSession s1 = new Microsoft.WindowsMobile.PocketOutlook.OutlookSession();
                Microsoft.WindowsMobile.PocketOutlook.Contact c1 = (Microsoft.WindowsMobile.PocketOutlook.Contact)s1.Contacts.Items[0];
                c1.JobTitle = "test2";
                if (c1.JobTitle != "test2")
                    MessageBox.Show("Didn't stick3");
                c1.Update();

                if (c1.JobTitle != "test2")
                    MessageBox.Show("Didn't stick4");

    For this test I'm using the evaluation version InTheHand 3.1 and I'm compiling for "Windows Mobile 5.0 PocketPC Device". 

    I tested on 3 PPC devices a Cingular HP MobileMessenger(WM5), Verizon SAMSUNG i760(WM6), and a Cingular Palm 750(originally WM5 upgraded to WM6).

    If I replace the JobTitle field with the AssistantName field then I don't see any messageboxes and I see the values being stored correctly in the debugger. 

     

  • 05-08-2008 4:16 PM In reply to

    Re: Contact Properites

    I can duplicate this when run on the v3.1 version, when run on 3.2 I do not get any of the Didn't stick messages. I don't know of a workaround I can suggest to fix this on 3.1, I can only suggest you switch to 3.2 instead.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
Page 1 of 1 (9 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.