Forum Discussion
AustinK
5 years agoQrew Commander
How are you calling the refresh? I have done this in the past with a JavaScript code page and had good success. I created a button that calls the below code in that page along with the Replication ID. Replication ID is numeric and 5 digits long, at least all mine are. I found this by watching network traffic when clicking the button.
After a user clicks the button on my page it hides the buttons(to prevent many clicks) and then waits for a response to the post. If the response is anything other than 2, it failed.
I cannot post all my code but hopefully this can push you in the right direction? I don't know of another way to grab the return message without using JavaScript.
You should be able to pull out more than just a fail or not in the response, the status is not the only thing returned. All I personally cared about was if it failed and to present a nice message to them, not to grab the actual fail message. Hopefully this is helpful.
After a user clicks the button on my page it hides the buttons(to prevent many clicks) and then waits for a response to the post. If the response is anything other than 2, it failed.
function refreshCall(repID){
$.post("yourDomain.quickbase.com/qb/sync/refreshTasks?replicationID="+repID, function(data) {
console.log(data);
}).then(function(data){
window.myData = data;
if(myData.currentRefresh.status != 2){
alert("An error message here.")
} else {
alert("Refresh was successful!")
}
});
}​
(I tried adding this as a code block of JavaScript and this forum ruined it at least on my end... sorry. Adding a screenshot of the formatted code to better help but leaving the text too just in case you see it correctly formatted.)
I cannot post all my code but hopefully this can push you in the right direction? I don't know of another way to grab the return message without using JavaScript.
You should be able to pull out more than just a fail or not in the response, the status is not the only thing returned. All I personally cared about was if it failed and to present a nice message to them, not to grab the actual fail message. Hopefully this is helpful.