-
Edit contact issue
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));[/CODE]
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?
-
Re: Edit contact issue
-21 would be Access denied: [url]http://www.developer.nokia.com/Community/Wiki/Symbian_OS_Error_Codes[/url], 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.
-
Re: Edit contact issue
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
}
}
}[/CODE]
pDatabase has type CContactDatabase.
contact - it is the contact we had modified.
contact->iPBContactId - its PhoneBook ID and has type TInt.
-
Re: Edit contact issue
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.