rbv_api.isDelete() works only for the first call

Posted by bakar on 03-Mar-2015 06:47

I have 1 object script trigger and want to evaluate whether a record has been deleted or not. The first time it gives a true, but later in the script I'm doing the evaluation again (wihin the same object script trigger), then it returns a false. Is this a bug?

All Replies

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

Can you please provide the object script you are using? It is better to understand what sort of operations happen between the two isDelete API calls.

Posted by pvorobie on 03-Mar-2015 11:22

rbv_api.isDelete() API returns true when called inside script which is running on "after Delete" or "Before Delete" timing options. It does not signal that particular record(s) has been deleted or not.

Posted by bakar on 03-Mar-2015 17:30

To reproduce:

- Create 1 object script trigger on create, update and delete. Put the content below:

rbv_api.println(rbv_api.isDelete());

rbv_api.println(rbv_api.isDelete());

- You will get a true for the first statement and a false for the second one after deleting a record

Posted by Godfrey Sorita on 04-Mar-2015 09:04
What version are you using? I tested this on 3.1.3 and got 2 TRUE results. Here are the steps made to test your scenario:

1. Create an object script using your code with After Create, After Update and Before Delete (After Delete is disabled in Object Script) timing.
2. Open the trigger debugger to get the run-time results.
3. Delete a record.
4. On the trigger debugger, click Refresh.

I got the following results on the trigger debugger:

Running VALIDATION_DELETE on Student (ID=20060)
Finished VALIDATION_DELETE on Student (ID=20060)

Running ON_BEFORE_DELETE on Student (ID=20060)
Checking trigger: log (ID=20055)
Running log on Student: Student (ID=20060)
DEBUGGING INFO:
true
true

===============================
Finished ON_BEFORE_DELETE on Student (ID=20060)

Running ON_AFTER_DELETE on Student (ID=20060)
Finished ON_AFTER_DELETE on Student (ID=20060)
Posted by bakar on 04-Mar-2015 09:49

Hi Godfrey,

Thanks for testing this in the newest Rollbase environment. Im using version 3.0.5. We will upgrade to 3.2 when its available.

Posted by pvorobie on 04-Mar-2015 10:57

I don't think that 3.2 has any changes in this functionality. 3.0.5 should work just fine.

Posted by Godfrey Sorita on 05-Mar-2015 09:25
I tested this on 3.0.5 and also got 2 TRUE results.
This thread is closed