×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Nov 2009
    Posts
    33

    Question Help!Problems about editing work phone number and home phone number

    Hi,I would like to edit work phone number and home phone number in my app.

    The link(http://wiki.forum.nokia.com/index.ph...t_Item)provide some information how to read and edit a contact item.
    The Code:

    ownCard = contactsDb->OpenContactL(ownCardId);
    CleanupStack::PushL(ownCard);


    ownCard->CardFields()[index].TextStorage()->SetTextL(KOtherForename);
    contactsDb->CommitContactL(*ownCard);

    CleanupStack::PopAndDestroy(2); // ownCard contactsDb


    But,when edit the phone nubmer,including mobile,home mobile,work mobile,home telephone,work telephone and so on,it can't work like the way above.
    i.e code:

    TInt index = ownCard->CardFields().Find(KUidContactFieldPhoneNumber);
    ownCard->CardFields()[index].TextStorage()->SetTextL(KOtherForeNumber);

    so,how to edit the work phone number or home phone number exactly?
    Last edited by UrNeighbour; 2009-12-23 at 07:30. Reason: edit some information

  2. #2
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: Help!Problems about editing work phone number and home phone number

    Quote Originally Posted by UrNeighbour View Post
    Hi,I would like to edit work phone number and home phone number in my app.

    The link(http://wiki.forum.nokia.com/index.ph...t_Item)provide some information how to read and edit a contact item.
    The Code:

    ownCard = contactsDb->OpenContactL(ownCardId);
    CleanupStack::PushL(ownCard);


    ownCard->CardFields()[index].TextStorage()->SetTextL(KOtherForePhoneNumber);
    contactsDb->CommitContactL(*ownCard);

    CleanupStack::PopAndDestroy(2); // ownCard contactsDb


    But,when edit the phone nubmer,including mobile,home mobile,work mobile,home telephone,work telephone and so on,it can't work like the way above.
    i.e code:

    TInt index = ownCard->CardFields().Find(KUidContactFieldGivenName);
    ownCard->CardFields()[index].TextStorage()->SetTextL(KOtherForeNumber);

    so,how to edit the work phone number or home phone number exactly?
    It's simple compare your code with the above code, And find out where is the difference,
    I think the difference is in GivenName and PhoneNumber,
    So check it.

  3. #3
    Registered User
    Join Date
    Nov 2009
    Posts
    33

    Re: Help!Problems about editing work phone number and home phone number

    Quote Originally Posted by rahulvala View Post
    It's simple compare your code with the above code, And find out where is the difference,
    I think the difference is in GivenName and PhoneNumber,
    So check it.
    Thanks Rahulvala.
    My code:
    //aNewContactInfo is a struct object that contains some Info of a contact,including FamilyName,
    //GivenName,MobiliNumber,WorkPhoneNumber,FamilyPhoneNumber

    TInt familyNameIndex=contact->CardFields().Find(KUidContactFieldFamilyName);
    contact->CardFields()[familyNameIndex].TextStorage()->SetTextL(aNewContactInfo->GetFamilyName());

    //edit given name
    TInt givenNameIndex=contact->CardFields().Find(KUidContactFieldGivenName);
    contact->CardFields()[givenNameIndex].TextStorage()->SetTextL(aNewContactInfo->GetGivenName());

    //edit mobile number
    TInt phoneNumberIndex=contact->CardFields().Find(KUidContactFieldPhoneNumber);
    contact->CardFields()[phoneNumberIndex].TextStorage()->SetTextL(aNewContactInfo->GetMobileNumber());


    the red part above is about editing the mobile number,but I don't know how to edit WorkPhoneNumber or FamilyNumber because I don't know how to find the field of work phone number of home phone number.It does not work like this:

    TInt homePhoneNumberIndex=contact->CardFields().Find(KUidContactFieldVCardMapWORK);
    contact->CardFields()[homePhoneNumberIndex].TextStorage()->SetTextL(aNewContactInfo->GetHomePhoneNumber());

  4. #4
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Smile Re: Help!Problems about editing work phone number and home phone number

    HI,
    COMPARE YOUR CODE WITH THE GIVEN BELOW LINK.

    http://wiki.forum.nokia.com/index.ph...a_Contact_Item

    BEST REGARDS,

  5. #5
    Registered User
    Join Date
    Nov 2009
    Posts
    33

    Re: Help!Problems about editing work phone number and home phone number

    Quote Originally Posted by rahulvala View Post
    HI,
    COMPARE YOUR CODE WITH THE GIVEN BELOW LINK.

    http://wiki.forum.nokia.com/index.ph...a_Contact_Item

    BEST REGARDS,
    Hi, Atually,I program my code as the way provided by your given link,and I can edit correctly and easily the FamilyName and the GivenName and MobileNubmer because I can find the ContactItemField related to FamilyName or GivenName or MobileNumber.the way is:

    //edit family name
    TInt familyNameIndex=contact->CardFields().Find(KUidContactFieldFamilyName);
    contact->CardFields()[familyNameIndex].TextStorage()->SetTextL(aNewContactInfo->GetFamilyName());

    //edit given name
    TInt givenNameIndex=contact->CardFields().Find(KUidContactFieldGivenName);
    contact->CardFields()[givenNameIndex].TextStorage()->SetTextL(aNewContactInfo->GetGivenName());
    //edit mobile number
    TInt phoneNumberIndex=contact->CardFields().Find(KUidContactFieldPhoneNumber);
    contact->CardFields()[phoneNumberIndex].TextStorage()->SetTextL(aNewContactInfo->GetMobileNumber());

    but,when I want to edit the FamilyPhoneNubmer and the WorkPhoneNumber,I cann't find the conttact item field related to them,
    so,how to get the contact item field relate to FamilyPhoneNumber and WorkPhoneNumber

Similar Threads

  1. Replies: 0
    Last Post: 2008-03-21, 10:20
  2. Retrieve caller phone number
    By f_ilie in forum PC Suite API and PC Connectivity SDK
    Replies: 0
    Last Post: 2007-01-22, 15:27
  3. How to retrieve the mobile number or home number or work number
    By Rameshwari in forum Mobile Java General
    Replies: 1
    Last Post: 2006-08-19, 00:17
  4. How to identify if mobile number of home
    By Blkangel in forum Symbian
    Replies: 0
    Last Post: 2004-05-03, 18:50

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •