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
bennyantony
Posts: 27
Registered: ‎03-27-2011
My Device: Z10,Q10,Z30
Accepted Solution

Invoking Calendar on work perimeter

I am using the following code, to invoke calendar from an app in Work Container, but calling the following is invoking the home calendar, not the work perimeter calendar. When I used similar code for invoking email client, it invoked email client in work perimeter. Can someone check the code and see what I am doing wrong?

 

    QVariantList participants = QVariantList();
    participants.append("a@abc.com");
    QVariantMap data = QVariantMap();
    data.insert(QString("participants"),QVariant(participants));

     InvokeRequest request;
     request.setTarget(tr("sys.pim.calendar.viewer.eventcreate"));
     request.setAction(tr("bb.action.CREATE"));
     request.setMimeType(tr("text/calendar"));
    QByteArray encData = bb::smileytongue:psObject::encode(data);
    request.setData(encData);
     bb::system::InvokeManager* m_invokeManager = new InvokeManager(this);
     m_invokeManager->invoke(request);

BlackBerry Development Advisor
shaque
Posts: 237
Registered: ‎07-14-2008
My Device: Not Specified

Re: Invoking Calendar on work perimeter

We will look in to this issue. But for now, you can at least specify the accountID of the calendar account you want to use to create the event. That should invoke the event create card with the specified account preselected.

 

Shadid

Developer
bennyantony
Posts: 27
Registered: ‎03-27-2011
My Device: Z10,Q10,Z30

Re: Invoking Calendar on work perimeter

Thank you very much for the response. I forgot to add an update to this. As you mentioned, I was able to call defaultcalendar and its supposed to return the calendar in the parameter and I used the accountid and folder id. i tried in 2 phones, in one phone it invoked the work perimeter and the other one still called the hybrid/home calendar. I will know only when I am able to test in mutliple devices..

 

Developer
bennyantony
Posts: 27
Registered: ‎03-27-2011
My Device: Z10,Q10,Z30

Re: Invoking Calendar on work perimeter

I was able to make it work by setting the accountId and folderId for the default calendar in work container(expecting there will be only one calendar in work container.