Problem with deleteRecord

Posted by johan.pouget on 06-May-2014 02:15

Hi,


I have a problem with deleteRecord API.

In fact, I would like execute a trigger for convert an object A to an object B and delete object A. These triggers are execute by a workflow.
If I execute both triggers in same time, the convertion execute correctly but I haven't the time to give a reason for the workflow because the delete trigger is executed in same time.
If I delayed deleteRecord trigger, this never executed because permission denied.


Have you got any solution ?
Thanks.


Edit : The logs for delayed delete trigger :

[2014-05-06 10:13:10,550] Running "Delete Record" for 40283 (40283)
[2014-05-06 10:13:10,556] ERROR: Error Wrapped p6.a475: Query API: permission to access Entering of my Collaborators denied for both current user and API user (line #4) in formula:
var rbv_api = new Packages.com.rb.core.services.api.ServerSideAPI(1, -1);

if ("VALID" == "VALID" || "VALID" == "REJECT") {
   rbv_api.deleteRecord("entering_of_my_collaborators", 40283);
}

All Replies

Posted by Laurent on 06-May-2014 09:02

Could you give more details about how the workflow and the triggers are connected? (i.e. is the workflow launched by a trigger, the other way around?)

Posted by johan.pouget on 06-May-2014 09:28

The workflow change the status of the record.

It called automatically by workflow status change.

delete trigger : rbv_api.deleteRecord("saisie", {!id});


If this trigger is delayed, not work, but if isn't delayed it work perfectly. Just I can't give a reason for my workflow. So I would delayed the delete trigger

Posted by Laurent on 07-May-2014 10:45

OK, I think I see what you're trying to achieve. The problem I can see here is that the workflow action is run on a record that is going to be deleted. So even if you entered a reason if would be deleted with the record.

This thread is closed