[V4.5.2] - rbf_deleteRecord() delete record permanently

Posted by IramK on 03-Aug-2017 04:40

Hello,

Is there a way I can delete a record permanently using the API rbf_deleteRecord() instead of the records getting moved to the recycle bin?

Cheers.

Iram

All Replies

Posted by Shiva Duriseati on 10-Aug-2017 01:00

Hi Iram,

One way to delete the record in recycle bin is to call an ajax get call in script component by passing action of type "purge" and "id" as query parameter.

Example:

rbf_deleteRecord("sample", 52723, function callback(arr){

location.reload(true);

});

$.get('{!#PROD_SERV_URL}'+"/m/recycleBin.jsp?act=purge&id=52723", function(data, status){

console.log("Data: " + data + "\nStatus: " + status);

});

Please note that this is a temporary solution and not recommended this might differ across future releases.(There must be some better way to do this).However I would encourage you to log an enhancement request for this so that our product management will review and prioritize this accordingly.

Regards,

Shiva

Posted by IramK on 10-Aug-2017 03:39

Hello [mention:efd18cd3210243c3a2645cbe9409d974:e9ed411860ed4f2ba0265705b8793d05] ,

Thanks for the temporary solution. Would I be able to use the same API call if I want to purge that record from server-side?

Iram

Posted by Shiva Duriseati on 10-Aug-2017 04:00

Yes you can make use of GET request using rbv_api.sendHttpGet()

Regards,

Shiva

Posted by IramK on 10-Aug-2017 06:23

Hello [mention:efd18cd3210243c3a2645cbe9409d974:e9ed411860ed4f2ba0265705b8793d05] ,

I tried doing that on the server side but I am getting an HTTP response to the login form and plus its not purging the record. Is there something extra I need to add to this?

var purgeUrl = "{!#PROD_SERV_URL}"+"m/recycleBin.jsp?act=purge&id=6107128";

 var info = rbv_api.sendHttpGet(purgeUrl);

 rbv_api.println(info);

Cheers.

Iram

This thread is closed