Read-only archive of the All About Symbian forum (2001–2013) · About this archive

Not able to map phone numbers

1 replies · 2,184 views · Started 04 April 2006

Hi All :

currently i'm facing problem regarding S80 phonebook.
i am able to add and fetch contact to and from phonebook programmatically...
but when i add contact manually :
say :

last name : sharma
first name : vijay
Telephone : 11111111
mobile : 22222222
Telephone(private) : 33333333
mobile (Business) : 44444444

i dont be able to differentiate among phone numbers.
viz. i can fetch all phone numbers but cant map like : 11111111 - Telephone
it fetches all phone numbers unorderly..
when i try to get label of contact : viz. Telephone(private)...it just returns blank string...

moreover the same code which i used in S80 .. working well with UIQ.

here code snippet is given below :


////////// code starts here

CContactDatabase *cdb=CContactDatabase::OpenL();

CleanupStack::PushL(cdb);

CContactItem* contactItem = cdb->OpenContactL(aContactItemId); //aContactItemId is being passed from somewhere else ...

CleanupStack::PushL(contactItem);

TBuf<50> tmpPhone;

TBuf<50> tmpLabel;

TInt MyIndex(-1);

do

{

tmpPhone.FillZ();

tmpLabel.FillZ();

MyIndex = contactItem->CardFields().FindNext(KUidContactFieldPhoneNumber,MyIndex+1);

if (MyIndex != KErrNotFound)

{

// Read values here

tempPhone = contactItem->CardFields()[MyIndex].TextStorage()->Text();

tempLabel = contactItem->CardFields()[MyIndex].Label(); //blank string returns here(S80) ......works well with UIQ

}

}while(MyIndex != KErrNotFound);

cdb->CloseContactL(aContactItemId);

CleanupStack::PopAndDestroy(2);




////////// code ends here

Cheers !!
CodePupil