My delayed trigger isn't working, for debugging purposes it currently only contains rbv_api.deleteRecord();. It is set to trigger on 'After create' of object 'Employee'. After 0 days, 0 hours, 1 minute the record should get deleted. It doesn't though. When I set trigger after to 0 days, 0 hours, 0 minutes it does get deleted.
According to the 'Debugging delayed triggers' section on page 203 of the Rollbase User Guide: "3. Remember that Object cript on delayed triggers require permissions assigned to "Query API" role. For information on security and access control, see Security and Access Control on page 377".
Because I'm just testing I changed the permissions to:
View | Create | Edit | Delete | ||||
Administrator | X | X | X | X | |||
Query API | X | X | X | X | |||
Record Creator | X | X | X | ||||
Portal Visitor | X | X | X | X |
Hi matman,
I tried the scenario as you mentioned but observed that i am bale to delete the record using "rbv_api.deleteRecord("onewqas", {!id})" and for object 'onewqas' i have given QueryAPI permissions only.
Are you using Private cloud? If So please let us know version you are using?
Thanks,
Rajkumar
Please check Queue of your delayed triggers and log file: use "View Events Log" button available for delayed triggers.
Thank you all for replying. I tried the several suggested things, I will also explain my scenario a bit more: In a record of Employer, I press the Quick Create button at field "Has Employees", to create an Employee. When the Employee is created, a delayed trigger get puts in the queue (Checked it many times, it does every time). And the created Employee gets added to the field "Has Employees".
Before saving, I delete the Employee from the "Has Employees" field. Because of this, the Employee is not related to any Employer. The delayed trigger is supposed to delete that Employee after about one hour. But it doesn't. But like I said, if I set the trigger to immediately, that Employee will actually get deleted.
The Debugger only shows a log of an 'After Update' trigger, set on the Employer object:
Running ON_BEFORE_UPDATE on Mat-Online (ID=108913968)
Finished ON_BEFORE_UPDATE on Mat-Online (ID=108913968)
Running ON_AFTER_UPDATE on Mat-Online (ID=108913968)
Checking trigger: checkHasEmployer (ID=108478233)
Employer Mat-Online (ID=108913968): No need to run: value of "Employers" was not changed: oldValue=108913967 newValue=108913967
No need to run this trigger on this record
Finished ON_AFTER_UPDATE on Mat-Online (ID=108913968)
The event log shows nothing extra, nothing to be reported. Also, adding some return true / false in the formula debugger, tells me that my code is working correctly as well.
Code:
if({!R108244227#id} < 0) { rbv_api.deleteRecord("employer", {!id}); }
Please use API
rbv_api.log("jobs", text);
to output any relevant debugging info info jobs.log file (use "View Events Log" button to access that file).
Matman,
Can you confirm if I the steps I've made below are similar to yours?
rbv_api.log("debug", "{!name#text}'s master: {!R108996412#id}"); if ({!R108996412#id} < 0) { rbv_api.deleteRecord("customer125", {!id}); rbv_api.log("debug", "{!name#text} has been deleted!"); }
In this example, 'Customer 1' has been deleted after 1 minute.
-Godfrey
I did it exactly the way you described above, the record gets deleted during validation, but not after the 1 minute test. What are your settings? My settings: Run trigger on 'after create', countdown starting at 'created at' with 1 minute of delay.
Trigger queue shows triggers correctly, after validating object script, log shows:
[2014-09-11 02:45:20,456] Joas Root's master: -1
[2014-09-11 02:45:20,459] Joas Root has been deleted!
During the real test, no logs were made. The event log doesn't show anything either.
My trigger is set to run relative to 'Current Time' after 1 minute. I also tried running the trigger relative to 'Created At' but it produced the same result.
Can you generate and upload your application XML? It would be much easier for us to debug this if we can test your application ourselves.
Attached is my application XML. You can install it in your zone to compare it with your application.
I removed the stuff talked about in this topic: https://community.progress.com/technicalusers/f/25/t/12685.aspx
I hope you are able to find something!
I was able to install your application in my zone. Interestingly, the related Medewerker record got deleted from the system after 1 minute.
Here's a recording of the test I've made:
[View:http://youtu.be/1pLit_mOqic:0:0]
Last week after struggling with trying to make the trigger trigger, I changed some things in my application before exporting it to .XML and then went off for the weekend. When I tried it this morning like I usually did, it suddenly worked. No idea why, but perhaps it has something to do with the things I changed. ( Talked about in this topic: community.progress.com/.../12685.aspx )
Reversing the situation to get back to the trouble I had before seems to be impossible. In other words: it's fixed. But I still wonder if it had something to do with the bugging 'Contact' attribute on the same object.
To Godfrey: thanks a lot for the great support, you're awesome! :)