Question
GovCIO
US
Last activity: 12 Mar 2018 23:22 EDT
How to capture the callback response (failure) to mobile app after sending a REST API call?
Hi,
We have a requirement like we send the DocuSign request from our PRPC V722 application and we check whether the request is successful or not from both Desktop and mobile versions. In Desktop version, we are printing the page level err message after getting the failure response from DocuSign but the same thing we want to achieve it in mobile side as well. I know we can't print the page level messages in mobile but we can give some alert to the user on the failure side. Can someone please help me on how to get the callback response in this mobile context?
Thanks,
Ravi Kumar.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
Depending on what version of Pega you are using, you should be able to create a Read/Write data page and put the value in there. Then add the data page to the offline data page white list. Link is in the Offline landing page from the designer studio. Then you can us
This still seems overboard. If the data sync succeeds, then the file got to the server. I still recommend just alerting if the subsequent data sync succeeds or fails.
- James
JPMorgan Chase & Company
US
Hi,
I hope you can use, Status update notifications provide flexibility because you determine when to send the notification. Status update notifications provide information on a task.
GovCIO
US
Hi,
I didn't get your point. Pls elaborate more on it.
Thanks
Ravi Kumar.
GovCIO
US
We are trying with the below option and will let you know.
top.launchbox.PRPC.ClientStore.addAction( undefined, undefined, JSON.stringify(metadata), JSON.stringify(data), writeSuccessCallback, failCallback );
Pegasystems Inc.
US
I think that is the wrong API to use for this. Please read through the API carefully.
I think you want to call launchbox.PRPC.ClientStore.addListener({onStatusUpdate: myListener});
function alertOnNextSuccess() {
_alertOnNextSuccess = true;
}
function myListener(status) {
if (status == launchbox.PRPC.ClientStore.Event.SUCCEEDED && _alertOnNextSuccess) {
_alertOnNextSuccess = false;
alert("Document uploaded successfully!");
}
if (status == launchbox.PRPC.ClientStore.Event.FAILED && _alertOnNextSuccess) {
_alertOnNextSuccess = false;
alert("Document has been stored on your device and will be uploaded next time the server is available.");
}
}
Something like this would be much more effective. Remember to wait until the launchbox API is available before trying to attach the listener.
- James
GovCIO
US
Thanks James. Let me check this and I will get back.
-
sailaja kasukurthi
GovCIO
US
Here is the simple option which I am trying for our requirement to show an alert for the connectivity issues while connecting Docusign from Pega
1) Wrote the below script in our mobile script rule's function
Here is the simple option which I am trying for our requirement to show an alert for the connectivity issues while connecting Docusign from Pega
1) Wrote the below script in our mobile script rule's function
2) Activity got called and setting the value of the property based on the success/failure of the connectivity. No issues in this step
3) After that I would like to capture this property value into a java script variable to show the alert and the next steps. But I am unable to capture the value using the below code after the above lines mentioned in #1. Not sure where I am missing. Pls guide me.
var val2=pega.ui.ClientCache.find("pyWorkPage.DSConnStatus").getValue();
alert(val2);
if(val2=="Fail") { //logic }
else{//logic}
Thanks,
Ravi Kumar.
Accepted Solution
Pegasystems Inc.
US
Depending on what version of Pega you are using, you should be able to create a Read/Write data page and put the value in there. Then add the data page to the offline data page white list. Link is in the Offline landing page from the designer studio. Then you can us
This still seems overboard. If the data sync succeeds, then the file got to the server. I still recommend just alerting if the subsequent data sync succeeds or fails.
- James
GovCIO
US
Thank you James for the quick response. We do have our own DP's in the mobile stand point. Let me check on how I can put this data into one of the DP's to read it.
-
Renuka Boddu
GovCIO
US
-
vikash kumar sahu