4.0.4 - Catch maximum Api hits per session

Posted by Meryk on 11-Feb-2016 11:44

Hello,

I am doing rbf_updateRecord on a big amount of records (on click on a button), more records than the maximum hits per session.

This means that not all the records will be updated and the user will have to come and click that button again. Which is fine. But I need to alert them that all their records haven't been updated (because of the max hits ), and ask them to log back again and do the update another time.

I am looking for a way to catch the error shown on top right of the page, or to know that the max hits has been reached.

Any suggestions to achieve this please ?

Cheers,

Meryem

Posted by Mohammed Siraj on 15-Feb-2016 08:44

The second argument to the callback function will identify the function by name i.e. it will be a string argument.

The call will be something like this:

rbv_errorsCallback(e.message, "rbf_updateRecord");

First argument (string), details the error & second argument identifies the function by name.

All Replies

Posted by Manooj Murali on 15-Feb-2016 04:06

Hi -

If I understand your requirement correct, then this is what you can do :

In a trigger, you can encapsulate the update logic with a try/catch block (java) and capture the exception in this case. The exception will have the message that the number of Ajax Api calls exceeded the specified limit.

Regards.

Posted by Meryk on 15-Feb-2016 05:50

Can I do a try catch block from client side, in a script component ?

The update I am doing here is done on the page itself, as it is based on the selected items on that page.

Thanks

Meryem

Posted by Manooj Murali on 15-Feb-2016 06:47

So, we have a client side api rbf_setErrorsCallback() using which you can set a function that will get the callback whenever there is an error in the api call. Please check out documentation.progress.com/.../

Posted by Meryk on 15-Feb-2016 08:40

Thanks Manooj for the reply. This function is overriding the default errors of any API and achieving what we wanted. But the issue is :

- It looks like it is catching ALL the errors of any api call. So for example, I have a rbf_setField() and a rbf_updateRecord() and they are both throwing errors. I want to catch only the errors from rbf_updateRecord. How can I do that ?

- Which bring us to the second question : How do we specify what api is concerned, as obviously we do not want to override all Api errors on the page.

Thank you

Meryem

Posted by Mohammed Siraj on 15-Feb-2016 08:44

The second argument to the callback function will identify the function by name i.e. it will be a string argument.

The call will be something like this:

rbv_errorsCallback(e.message, "rbf_updateRecord");

First argument (string), details the error & second argument identifies the function by name.

This thread is closed