Delete record function like selectObject

Posted by IramK on 02-Mar-2015 03:15

Hello,

I am trying to perform a delete record by using the built-in rollbase function that is not available to the user like selectObject(objId, ObjName). I have seen a function called : rbf_doSingleDelete() but I'm not sure what parameters it takes. Could someone point me out in the right direction?

All Replies

Posted by Manooj Murali on 02-Mar-2015 03:23

I am not sure what you mean by 'function that is not available to the user' but may be you can try out rbf_deleteRecord which takes object name, id and a callback function.

-Thanks,

Manooj

Posted by IramK on 02-Mar-2015 03:40

Ok that would work but basically I am trying to do that on the view page for both delete and detach options and I think it uses an rbf_doSingleDelete for the record that is selected if I'm not wrong. Likewise it does a rbf_doRelRemove() for a detach. rbf_deleteRecord would work for delete. What would the best function that would work for a detach?

Posted by Sharavan Kumar on 02-Mar-2015 03:43

Hi ,

Here is the sample example

rbf_deleteRecord("test_QueryApi", 125872118, callback_delete);

function callback_delete(arr)

{

alert("record is deleted");

}

thanks,

Sharavan

Posted by Manooj Murali on 02-Mar-2015 03:51

I don't think there is a ready-made function for that. Also, please note that the suggested rbf_deleteRecord wouldn't give you a pop-up unlike rbf_doSingleDelete does.

But, can you please let us know why you have to override these behaviors in the first place?

Posted by IramK on 02-Mar-2015 03:57

Basically I am trying to display a pop-up window of my own when we click on the "del" or "detach" button on the list item that would display a custom message rather than the built-in Rollbase message and I would like to drive the user from there to a few more pop-up windows i.e. a series of questions that would allow me to decide whether the user is ok to delete the record or would prefer detaching it etc. Hence I am trying to tap into onclick functions of the delete and detach buttons and do some specific behavior that would allow me to decide the users intention. Hence the approach of overriding the current behavior.

Also please note this:

https://community.progress.com/community_groups/rollbase/f/25/p/16122/57957.aspx?Redirected=true#57957

I have tried getting access to the Detach functionality but I think it currently doesn't work as expected.

Posted by pvorobie on 02-Mar-2015 11:59

rbf_doSingleDelete is internal API and is not supposed to be used by app developers. Please use rbf_deleteRecord instead.

Posted by IramK on 02-Mar-2015 15:56

And what do I use for detach a record? I managed to use delete record but I am unable to decide on what to use for detaching a record.

Posted by pvorobie on 02-Mar-2015 16:05

There is no special client-side API for detaching records, but you can use rbf_setFieldValue on lookup field.

Posted by IramK on 05-Mar-2015 05:56

Could you suggest me as to how I can set the field value of the lookup field on the View page when I click on the detach button? I can get to the ID of the record that is being detached. I just need to be able to set the field value (as you suggested) on the View Page.

I have tried using:

rbf_setFieldValue("R12345", null);

rbf_setFieldValue("R12345", objRecordID);


R12345 is the related lookup field integration name.

But the above doesn't seem to work on the View Page. Could you possibly suggest a way to set the Lookup field value on the View page?

Posted by Gian Torralba on 05-Mar-2015 10:58

Hello,

rbf_setFieldValue() is used in Rollbase forms that's why it is not working. You can use rbf_updateRecord() to update the record instead. For reference, go to Chapter 14: Reference > Client-side AJAX API in the Rollbase User Guide.

Thank you,

Gian

This thread is closed