Hello,
I have a portal page and when I have an error on the portal page, it just gives a javascript error in the console:
Uncaught ReferenceError: rbv_error_title is not defined main.js:9
There is no error pop-up being shown in portal pages to show what the error is. Looks like a bug to me. Please let me know when this would be fixed.
Cheers.
Iram
Yes Iram, such errors will also be reported in error callback handlers for public documented client-side API functions.
Any possible fixes for this?
We have taken note and will confirm a fix release soon.
A workaround I can suggest for now would be to add the following custom script into your portal's Header and Footer config (Setup > Your Portal > More Actions > Header and Footer)
<script> rbv_error_title = 'Error!' rbv_warning_title = 'Warning!' rbv_success_title = 'Success!' rbv_information_title = 'Information!' rbv_logicalCond_AND = 'AND' rbv_logicalCond_OR = 'OR' </script>
Only downside to this workaround is the text will not be localized. We will fix this as soon as possible.
Hello Santosh,
Will the error pop-ups be shown by this workaround?
Iram
Hello Santosh,
I have added that script but its still not showing the error pop-up. In order for me to see the actual error I need to refresh the page which is not good at all. Can you please try that out and provide a workaround for this as soon as possible.
Cheers.
Iram
Hello,
Any updates on this?
Hello Iram,
As communicated by Santosh earlier, this is a valid issue & we will be resolving it for 4.3.
For a temporary workaround, in case you are explicitly calling rbf_growl, ensure that you guard this function call within try/catch block. Calling this method is resulting in this exception and breaking your script.
Going forward we will also ensure that such errors are reported on browser console.
Regards,
Siraj.
Hello [mention:78c86023544844079dc6455a4a7a4d57:e9ed411860ed4f2ba0265705b8793d05] ,
Thanks for the update. Is there a way we can catch the error messages when they pop up? Say for example: If I have a selectQuery on change of a field and that query is incorrect, there is an error message that pops up. Is there a way to catch this? If there isn't, could you possibly provide support for this in 4.3?
Also what's the release date for 4.3?
Cheers.
Iram
Iram, for exception and errors generated in documented API functions, Rollbase will call an error handler function i.e. 'rbv_errorsCallback', if configured. That is, this function should be defined by end-users interested in error callbacks.
That is, once you define
rbv_errorsCallback = function(errorDetails,apiMethodName){
alert('Error in: '+apiMethodName);
};
if there is an error while executing any documented API function like
rbv_api.selectQuery2, this error handler function will be called with error details.
Hello [mention:78c86023544844079dc6455a4a7a4d57:e9ed411860ed4f2ba0265705b8793d05] ,
Ok thats good to know, however what happens if there are platform errors like "API limit exceeded error"? Can we track that?
Cheers.
Iram
Hi IramK,
About the release date, its tentatively planned for the last week of august.
Regards,
Shivali
Yes Iram, such errors will also be reported in error callback handlers for public documented client-side API functions.
Hello Siraj,
Thanks for your reply. So once we do catch an error, is there a way we could stop the API functions from running again and again?
For Example:
1) If the SQL Query is too long, I would like to stop the selectQuery to run again and again and fire the same error_callback multiple times.
2) API Limit exceeded error: If the API limit has exceeded, I would like to stop the selectQuery to run again and again and fire the same error_callback multiple times.
Any suggestions?
Iram
Iram, on the client-page you can initialize a global variable to serve as a flag to indicate such a scenario and accordingly abort any following API calls (you might be doing in a loop construct).
Across the session, you can write and read the flag from HTML5 browser session storage. For which you can leverage the following API calls (available only in NewUI pages).
rb.newui.util.addToSessionStorage(storeKey, storeVal)
rb.newui.util.getFromSessionStorage(storeKey)
However, please avoid writing bulk information to sessionStorage as it is limited space per domain and may affect Platform behavior if exhausted.
Note: With the above API you can write and read JSON objects from session storage without requiring the overhead to convert them to/from Strings.
Hello [mention:78c86023544844079dc6455a4a7a4d57:e9ed411860ed4f2ba0265705b8793d05] ,
Thanks for the answer and the suggestion. There is only one issue in this case, I'm not on the NewUI pages. Its a portal page as mentioned in my question. So I don't think I'd be able to leverage the SessionStorage function. What do you suggest?
Cheers.
Iram
Right. The above mention function definitions are available only on a NewUI page.
However, these are just utility methods that internally leveragy HTML5 sessionSotrage API. You can very well consider using it directly. Here are some utility methods that you can add to your page:
function getFromSessionStorage(storeKey) {
var storeVal = (storeKey && sessionStorage.getItem(String(storeKey))) || null;
try {
//will always JSON.stringify before adding to sessionStorage..
storeVal = (storeVal !== null) ? JSON.parse(storeVal) : null;
} catch (err) {
storeVal = null;
}
return storeVal;
}
function addToSessionStorage (storeKey, storeVal) {
storeKey = storeKey && String(storeKey);
if (!storeKey || storeVal === undefined) {
return;
}
try {
sessionStorage.setItem(storeKey, JSON.stringify(storeVal));
}
catch (err) {
console && console.error("[Error] Failed to update Session Storage " + err);
}
}
This hasn't been fixed in neither Version 4.3 nor Version 4.4. The error message pop-up still doesn't show up in the portal pages when the API limit has been exceeded.
Iram