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?
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.
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.
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
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)
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.
I don't think that 3.2 has any changes in this functionality. 3.0.5 should work just fine.
I tested this on 3.0.5 and also got 2 TRUE results.