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?
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?
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.
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?
Here is the sample example
rbf_deleteRecord("test_QueryApi", 125872118, callback_delete);
alert("record is deleted");
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?
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:
I have tried getting access to the Detach functionality but I think it currently doesn't work as expected.
rbf_doSingleDelete is internal API and is not supposed to be used by app developers. Please use rbf_deleteRecord instead.
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.
There is no special client-side API for detaching records, but you can use rbf_setFieldValue on lookup field.
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?
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.