Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User sani_ok's Avatar
    Join Date
    Nov 2011
    Posts
    47
    Hi, All. I'm trying to edit contact using next code.

    Code:
    	CPbkContactEditorDlg *dialog = CPbkContactEditorDlg::NewL(*iEngine, *contact, EFalse, -1, ETrue);
    	TContactItemId contactID = KNullContactId;
    	TRAPD(dialogError, contactID = dialog->ExecuteLD());
    
    	if (contactID == KNullContactId)
    	{
    		phoneBookResource.Close();
    
    		return EFalse;
    	}
    
    	TRAPD(error, iEngine->CommitContactL(*contact));
    Last command return -21, but contact saved successful and I can see changes in contact book. On other hand a LAST_MODIFICATION_TIME=0, and I can not check which contact was modified. Where is my mistake?

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,672
    -21 would be Access denied: http://www.developer.nokia.com/Commu...OS_Error_Codes, so could be that you are missing some capability, then again would be surprised that all works there.

    If you have problems with some LAST_MODIFICATION_TIME, then you should also show snipped for that part, otherwise we would need to do some guessing here.

  3. #3
    Registered User sani_ok's Avatar
    Join Date
    Nov 2011
    Posts
    47
    Sorry, my fault. LAST_MODIFICATION_TIME - it is just a time of last contact modification.

    By the way, I found that next function works fine on all devices except FP1. On FP1 this function return time 00:00.

    Code:
    CContactItem *pContactItem(NULL);
    if (contact)
    {
    	if (contact->iPBContactId != KNullContactId)
    	{
    		pContactItem = pDatabase->ReadMinimalContactLC(contact->iPBContactId);
    	
    		if (pContactItem)
    		{
    			TTime lastMod = pContactItem->LastModified(); // lastMod == 00:00
    		}
    	}
    }
    pDatabase has type CContactDatabase.
    contact - it is the contact we had modified.
    contact->iPBContactId - its PhoneBook ID and has type TInt.
    Last edited by sani_ok; 2012-11-06 at 14:40. Reason: Update information

  4. #4
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,672
    ok, never used that one. and if you say that it does not work on some version of the platform, then it is likely a bug on that platform version. If the version is newest one, then of course you could make bug report for it.

Similar Threads

  1. How to edit and update contact into phone book
    By sid_diu in forum Symbian C++
    Replies: 2
    Last Post: 2011-05-02, 08:34
  2. edit phone contact list
    By mahdi68 in forum Mobile Java General
    Replies: 4
    Last Post: 2010-05-27, 10:08
  3. edit phone contact list
    By mahdi68 in forum Symbian C++
    Replies: 7
    Last Post: 2010-05-22, 13:48
  4. edit or add fields to a contact number of phonebook ?
    By jyotideep in forum Symbian C++
    Replies: 2
    Last Post: 2007-10-31, 05:24
  5. contact edit(help)
    By qiangsir in forum Symbian User Interface
    Replies: 3
    Last Post: 2005-05-03, 10:24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved