Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
simon_hain
Posts: 16,093
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Edit a created contact using invocation

I am trying to edit a contact i just created with the native card.

I am following the guidelines from

https://developer.blackberry.com/cascades/documentation/device_platform/invocation/contacts.html

 

Contact createdContact = contactService.createContact(builder, true);
qDebug() << "created Contact, id " << createdContact.id();
//2. invoke the contact edit card with the created contact
invocation = Invocation::create(InvokeQuery::create().parent(this).mimeType("application/vnd.blackberry.string.contact, application/contact").data(QByteArray::number(createdContact.id())).invokeTargetId("sys.pim.contacts.card.composer").invokeActionId("bb.action.EDIT"));
invokeActionId = "bb.action.EDIT"; //store the action for onArmed() slot
connect(invocation, SIGNAL(armed()), this, SLOT(onArmed()));
connect(invocation, SIGNAL(finished()), invocation, SLOT(deleteLater()));

 I get this output:

Debug: 16:06:51.464 created Contact, id  261 
Warning: 16:06:51.485 InvocationWrapper::onQueryFinished: no matching result from Menu Service for query
   mimeType="application/vnd.blackberry.string.contact, application/contact"
   uri=QUrl("") 
   data= "261" 
   metadata= QMap() 
   perimeter= 0 
   action= "bb.action.EDIT" 
   target= "sys.pim.contacts.card.composer" 
   invokerIncluded= false 
Warning: 16:06:51.488 InvocationPrivate::onQueryResolved: no result matching query, no armed signal sent. 

 What am i doing wrong?

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Regular Contributor
aesteral
Posts: 51
Registered: ‎02-24-2012
My Device: Blackberry Whatever
My Carrier: Ukrtelecom

Re: Edit a created contact using invocation

Same thing.

 

InvocationWrapper::onQueryFinished: no matching result from Menu Service for query
   mimeType="application/vnd.blackberry.string.contact"
   uri=QUrl("") 
   data= "24" 
   metadata= QMap() 
   perimeter= 0 
   action= "bb.action.EDIT" 
   target= "sys.pim.contacts.card.composer" 
   invokerIncluded= false 
InvocationPrivate::onQueryResolved: no result matching query, no armed signal sent. 

 

Can not use bb.action.CREATE for sys.pim.contacts.card.composer and bb.action.ADDTOCONTACT as well.

Please use plain text.
BlackBerry Development Advisor
shaque
Posts: 234
Registered: ‎07-14-2008
My Device: Not Specified

Re: Edit a created contact using invocation

You cannot use two mime types at the same time. You only need to use one. I would use the first one from the docs for edit.

 

Shadid

Please use plain text.
Regular Contributor
aesteral
Posts: 51
Registered: ‎02-24-2012
My Device: Blackberry Whatever
My Carrier: Ukrtelecom

Re: Edit a created contact using invocation

Thank you, Shadid!

But please note that I'm using a single mime-type in my query and still can't get contacts cards invoked.
Please use plain text.
Developer
simon_hain
Posts: 16,093
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Edit a created contact using invocation

Iirc i also tested it with only a single mime type.
Can you take a short test Shadid and post the working invocation code here?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
BlackBerry Development Advisor
shaque
Posts: 234
Registered: ‎07-14-2008
My Device: Not Specified

Re: Edit a created contact using invocation

Let me create a sample and post here. Need some time. When do you guys need it? Other than ASAP? :smileyhappy:

Please use plain text.
Regular Contributor
aesteral
Posts: 51
Registered: ‎02-24-2012
My Device: Blackberry Whatever
My Carrier: Ukrtelecom

Re: Edit a created contact using invocation

As you well know, it's always ASAP :smileyhappy: Now it is because of the BFB deadline. Maybe you can just show some samples, like a correct InvokeAction or Builder command?

 

Thank you!

Please use plain text.
Developer
simon_hain
Posts: 16,093
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Edit a created contact using invocation

the contact builder works correctly (since i figured in the comments from JIRA about having to add a subattribute to the address).
I would like to see a snippet about invoking a freshly created contact in an edit card.
its not a core functionality, and i cannot test it right now as i have to do some maintenance on a bb java project, but my colleagues are working on bb10 and could incorporate it.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
New Contributor
intel3
Posts: 7
Registered: ‎10-11-2009
My Device: Not Specified

Re: Edit a created contact using invocation

I am trying to call it from QML and it is not working.

 

actions: [  
          InvokeActionItem {
                title: qsTr("CreateContact")
                ActionBar.placement: ActionBarPlacement.OnBar
                
                
                query {
                    invokeTargetId: "sys.pim.contacts.app"
                    invokeActionId: "bb.action.ADDTOCONTACT"
                    mimeType: "application/vnd.blackberry.string.phone"
                    
                }

                onTriggered: {
                    data&colon; "999451624"
                }
         }
]

 

any idea why?

Please use plain text.
BlackBerry Development Advisor
shaque
Posts: 234
Registered: ‎07-14-2008
My Device: Not Specified

Re: Edit a created contact using invocation

Escalated to Contacts App team. Please stay tuned.

 

 

Please use plain text.