Add Contact OS10

Published by oros: moved blocks of code to code for readablity.

 

At the following example of the API doc

function onSaveSuccess(contact)
 {
    //console.log("Contact with id=" + contact.id + " is saved!");
    alert("Contact with id=" + contact.id + " is saved!");
 }

function onSaveError(error) {
   // console.log("Error saving contact: " + error.code);

   alert("Error saving contact: " + error.code);
}

function createContact() {
    var contacts = blackberry.pim.contacts,
        ContactField = contacts.ContactField,
        name = {},
        workPhone = { type: ContactField.WORK, value: "0046856400500" },
        workEmail = { type: ContactField.WORK, value: "[email protected]" },
        homeEmail = { type: ContactField.HOME, value: "[email protected]" },
        contact;

    name.familyName = "Engelbrecht";
    name.givenName = "Ingvar";
    contact = contacts.create({
         "displayName": "ingvar_e",
         "name": name,
         "phoneNumbers": [workPhone],
         "emails": [workEmail, homeEmail]
    });
    contact.save(onSaveSuccess, onSaveError);
}

added to the config

    

    
        read_geolocation
        access_shared
        access_pimdomain_contacts
    

received the message:

Eception type error: cannot read property 'contact' undefined

additional

When I first studied for more information, I ended on the next page, which contained no information at all, but that looked exactly like the normal API documentation. Please delete!

https://developer.BlackBerry.com/HTML5/APIs/BlackBerry.PIM.contact.html

This problem happens on the device or in the ripple? If the ripple, please note that blackberry.pim is not actually set / available here.

BB10 Documentation: https://developer.blackberry.com/html5/apis/blackberry.pim.contacts.contact.html

EDIT: Note that your link to documentation is BBOS PIM API: https://developer.blackberry.com/html5/apis/blackberry.pim.contact.html

You need to test a physical Simulator / device. If it's not training, if you run the following three lines of code before the identified error line, can you please confirm the exit?

console.log(blackberry);
console.log(blackberry.pim);
console.log(blackberry.pim.contacts);

I expect that you will get:

(1) an object.

(2) undefind.

(3) the thrown error simliar to the original.

If this is the case, the question will be how the API is included (and I have a few additional questions.)

Tags: BlackBerry Developers

Similar Questions

  • How to add contacts to my Apple Watch?

    Can someone explain how to add contacts to my Apple Watch 2, watch OS 3

    Hello

    Apple Watch is not a Contacts application and it is not possible to create new contacts on your watch.

    When make calls or send new messages, existing between in contact with instead are selectable via the phone and applications or Messages using Siri / the microphone to dictate a phone number:

    Instructions are available here:

  • We can add contacts for Mozilla Firefox so that when send us messages, it will be easier?

    When I try to send a message to make me watch add contacts so I thought it would be easier if you could add it

    Contacts? As in e-mail?

    Firefox does not have an email, there is no interest in being able to record "contacts" in Firefox.

  • Add contact based on the username: too many results!

    Someone gave me their exact Skype username. Now, I want to add this contact.

    When I go to add contact and enter the user name, I get a long list of search results. The results do not show user names, but rather their real names. How can I know who is the person with the username? Is there a way to check the user name?

    If you are looking for using the exact name of Skype, then as a general rule, the first result displayed should match this user. However, you can always check it out by clicking on the display of the results and see the selection profile. You are looking for which is shown as the Skype name.

  • Do not add contact icon

    I've lost the ability to add contacts add contacts as well as those for phone icon and group are missing. Added contacts in the past but now can add only to the Skype directory by using the toolbar.

    I just finished the uninstalling and re - install Skype, ver 7.0

    Thanks a lot for pointing this out.

    And outside.

  • XPRT: Adding a new contact add contact to ALL my accounts

    I just changed the XPRT so I hope that this issue is something that I just do bad. When I add a new contact on the phone, the contact is added to all my accounts (in this case 7 accounts), and each of them appears as a contact with 7 links. I don't see a place to specify the account to add contact when I'm creating, or when I try to change it.

    What I'm missing here? Is there a way to specify the account to add the contact to?

    Thanks in advance for your help.

    -Alex

    Welcome.

    I think that what you are looking for and im do not know because I only have my google

    account for the contact is:

    If you go to your contacts, press menu, select, then

    Parameters. I think that you can choose which accounts get link and which are not.

    Thank you

    J

    Sent from my Motorola XPRT

  • How to add contacts to your existing groups or how to manage your groups?

    Anyone know how to add contacts to your existing groups or how you manage your existing groups. How do you even add new groups I can't find a way to do this in the ocntacts.

    Hello

    1. what version of Windows is installed on the computer?

    2 are. what groups you referring?

    3. What mail client do you use?

    If you use Hotmail, you can post your request in the Windows Live Forum.

     

    http://answers.Microsoft.com/en-us/windowslive/Forum/Hotmail

    You can check the link:

    http://Windows.Microsoft.com/en-us/Windows-Live/Mail-import-backup-restore

     

    Please get back to us with the above information so that we can help you accordingly.

  • Cannot add Contacts in my Windows Live Mail account.

    Hi, just wondered why I can't add contacts to my windows email account?  Is there a limit to how many contacts you can have?  Please answer.  Thank you.

    David

    Hello

    Please repost your question on the Windows Live Solution Center-Live Mail , where an expert in this field would be better suited to provide you with a solution.

  • Cannot add contacts in Windows Mail

    I can't add the contact to my Windows Mail. When I opened the box of contacts list, there is no current option to add contacts. Any suggestions?

    Thank you.

    Linda

    I can't add the contact to my Windows Mail. When I opened the box of contacts list, there is no current option to add contacts. Any suggestions?

    Thank you.

    Linda

    Open Windows Mail > click Contacts > right-click on an open space inside the right column > click Customize this folder > in the file types you want, click the arrow on the far right, until you see Contact, until it clicks > OK

    t-4-2

  • BlackBerry Q10 Howto add contacts to speed dail?

    Can someone help me step by step how to add contacts to speed dial numbers using the keyboard?

    I tried the phone application, go to settings to set speed dials. , but when I try to set up the speed dial, I pressed the key word I want to first, and nothing happened. What should I do?

    Nice day

    Welcome to the BB forums

    Have you updated to 10.1 yet? case then here is the info you need and other options to help you in the future!

    Add a contact or number to your speed dial list

     

  • Cannot add Contacts Windows Live Mail rule

    I'm trying to implement the rules of e-mail in Windows Live Mail on Windows 7 computer. I would first of all a folder to retrieve messages from all my Contacts (i.e. real people) and another to retrieve messages from organizations, I am interested in / attached to but whose email I have to see every day.

    Have implemented a rule, I cannot add Contacts, even if it seems that I should be able to. Specifically, I'm trying to set up a rule to sort mail "when the line contains people". In the box "Select individuals", the statement is to "enter one name at a time and click Add, or select the names of your Windows Live Contacts" HOWEVER, we don't know don't not how to select the names of the Contacts. When I click on the Contacts button, I just get a list of Contacts but can't copy and add names to the mailbox rules.

    I'm not typing one by one. I need help.

    Thank you.

    While in the message rule, click the Contacts button and then double-click a Contact , and click Add. That should add to the rule.
     
  • BlackBerry App cannot add contacts on whatsapp on z10

    Can someone tell me please how to add contacts on the z10 blackberry whatsapp.  My old whatsapp contacts that were on my old phone appear with the name - but I can not enter all new contacts - faves tried and everything.  You can only manually enter the phone numbers for cat - which is very annoying.  My whatsapp contacts are on my list of regular contacts.  BlackBerry also has to offer the possibility of whatsapp for contacts, as they do with sms, email, options when you view a contact.

    Here's the process:

    (1) enable WhatsApp Messenger to access your contacts database (this is done in the Z10 security options)

    (2) create a contact base (I use one that is related to my email provider, GMail)

    (3) in this database of contacts, create a new entry with a mobile phone number

    (4) after some time WhatsApp will display this contact in the contacts tab. And when that person will use WhatsApp, on their side, the contact will also be in the tab Favorites (so no need to type in their number and more).

  • Smartphones blackBerry eception exception: cannot add contacts

    untrapped exception net_rim_bb_addressbook_app (303) does not. the process is completed.

    Always get this error message, cannot add contacts on my phone. Bold 9700 OS6.

    kindly help

    freestyle2580 wrote:

    still can't add contacts on my phone

    This has been a recurring problem for the phones Blackberry OS5 and below. Please click the link below:

    Cannot change or create new contacts to the address book of BlackBerry

    Ron

  • BlackBerry smartphones Add Contact Pro app - download problem

    Hi all

    I have the BB 8520 curve. Last week I bought 'Add Contact Pro' on Blackberry app World. After purchase and during the download I received an error and stopped the whole process. The app didn't download. I sent mail to the developer app three times but no response.

    Can someone help me on how to download again (I did purchase)?

    Thank you

    Atomleaf

    Hello and welcome to the community!

    I suggest that you clear the cache of the AppWorld application.

    For legacy devices (pre-BB10):

    1. open the App World

    2. go to my world

    3. follow one (and only one!) of these steps:

    3. for the BB keyboard-oriented - hold down the ALT key and press on, in the sequence R, then S, then T

    3B. for touch screen only BBs - hold the num-lock (! 123 button) so that it hangs and then press on, in the sequence 3, then 4, then)

    3 c for the most recent (e, g., OS6 and 7) BB s, see this KB:

    • KB24714 How to clear the cache of BlackBerry App World

    4 AppWorld must close.

    5. If your BB locks after issuing clear cache, do a battery pull reboot

    6. return to AppWorld/MyWorld (it can be slow, while it re - sync). .

    If (4) stage arrives not as described, then the empty the cache failed.

    For BB10 devices:

    • KB33818 Applications in BlackBerry World are stuck in a State facility and cannot be cancelled or removed from the download list

    After the empty Cache, then to re - install the app, please see this KB:

    • KB17625 How to install or transfer has already purchased apps from BlackBerry App World for BlackBerry smartphone

    Good luck and let us know!

  • BlackBerry smartphone how to add contacts in Messenger BB 8800?

    Hello!

    I have a BB 8800 but I can't add contacts in blackberry messenger... someone help me in this regard?

    Thank you.

    Why you can not? Here is the link with the procedure

    http://www.BlackBerry.com/BTSC/search.do?cmd=displayKC&docType=kc&externalId=KB04663&sliceId=1&docTy...

Maybe you are looking for

  • Page of Safari called appleissue.online

    I can't remove the safari page, I've tried the command Q, command w. and restart my mac. nothing gets rid of the page.  It's a scam page is loaded from the internet.

  • Portege R500 - configure the parser on the Port Replicator

    The system is Portege R500 with a port replicator Port MS Vista running. Port replicator has a Philips 19 "LCD monitor System has BEEN configured so that when the system was in the duplicator monitor 19 "inches would be active and system monitor is i

  • Re: Need drivers for Satellite 1900 101

    Need drivers for Satellite s1900-101.

  • My email has been hacked two days ago.

    I've followed all the advice on changing password, run anti virus and anti malware scans, but it seems that the same thing happened last night, all this be it on a smaller scale. Is there anything else I can do?

  • The UNIT-D/120JCTLS =, same PN but different cards?

    I'm an analog integration in a PBX using a STM - 7835 H - 3.0 - ECS1. I put in one D/41F and double D/120JCT cards. D/41F and D/120 comes with the correct universal PCI interface. The second D/120 comes with a standard PCI interface. Am I an old map