Using the Hybrid Client API within a Pega application is not Working
Hi GCS, I am working on the tutorial given inthe link https://pdn.pega.com/tutorial-using-hybrid-client-api-within-pega-application, but I am not able to achieve the output in the mobile though I have done and followed same steps.could you please help me on this if any additional configuration is to be done.The functions in the script are not getting called.Please help on this
***Updated by moderator: Lochan to add Categories***
-
Like (0)
-
Hi pradeep koutha - could you please give us more details ? Could you please point me to application you created (and doesn't work) ? Are you using HC downloaded from application Mobile Tab, or Pega7 from App Store/Google Play ?
Hi Michal ,
I have implemented the same by following the tutorial
Tutorial: Using the Hybrid Client API within a Pega application
from the link
https://pdn.pega.com/tutorial-using-hybrid-client-api-within-pega-application
Here I created the perform harness with textinput to enter the name.
And the button FINDCONTACT which runs a script on button click.
This JS Contacts_api_example has the function contacts_api which is called on the button click.
But the function is getting called
and findCallbacks is not getting called.
Hi Michal ,
I am not able to grant you access,for this.(I tried to build again in pega cloud but failed to create JS)
Have you tested this tutorial implementation?
If so is the application fetching contacts results from our own mobile phone ? (how the code is getting data from mobile sim data ? )
Android I have used 4.4.2
and pega version is 7.1.9
Yes, I followed the tutorial, and it works for me, although I used Pega7 7.2 on Android 5.0.
Please note that there were some changes in the tutorial - you may now copy javascript snippet and paste it into your Designer Studio - it should reduce possibility of typo.
Also - I noticed minor mistakes in javascript snippet which have been fixed today.
So could you please try copying js snippet to your application and try again.
Note, that this tutorial doesn't work for offline enabled cases.
PS For more detailed documentation regarding Contacts API see https://community.pega.com/sites/default/files/mobileclient/6200/api/client_api/container_object_contacts.html#
pradeep koutha Did you manage to use HC API in your PRPC application ? Do you need any more assistance ?
hi Michal , Now I copied the js from that tutorial . But here when we run the case.
We have
1.Enter Name Field where I enter name.
2.Find Contacts button , on this click function contacts_api(name) is getting called.
3.We have results and I have given DATAFIELD control and here we need to give the property name?
I had used .ContactRsults now , but not able to get the result . In the Script they used
var results = document.getElementById("ContactsResults");
Exactly what this code do ? It takes textarea property name ?
document.getElementById() is a standard javascript method which looks for DOM element with given id, and PRPC generates ids for controls (textarea in this case) using name of property it is bound to (here: ContactsResults). I think it would be easier to work on a common Pega7 instance - do you have access to instance in cloud ?