Receiving a query API permission error on a batch job

Posted by jsniemi79 on 19-Nov-2014 09:47

I have a data maintenance batch job that is running object script to fire a create record trigger.

When the batch is run, I am getting an error stating the current user and API user do not have persmission to access this object. 

However, my Query API has view/create permission on the advance object as well as the object that is being created from the trigger (Daily Calculations).

What am I missing?

All Replies

Posted by Gian Torralba on 19-Nov-2014 09:57

Hello,

Can you try running the batch job manually? It should run fine if you already enabled the Query API permission for the data maintenance object, the object that holds the create record trigger and also the object that is being created from the trigger.

Thank you,
Gian

Posted by jsniemi79 on 19-Nov-2014 10:01

Yes, I can run the batch manually and it works fine.  It just doesn't work if I let the scheduler run it.

Posted by Gian Torralba on 19-Nov-2014 10:18

Hello,

Can you try adding a Query API permission to the User object?

Thank you,
Gian

Posted by jsniemi79 on 19-Nov-2014 10:58

Hi Gian,

i tried to add view permission to the user object, but I received the same error message.

Posted by Gian Torralba on 19-Nov-2014 11:30

Hello,

Can you post the code in the batch job as well as the trigger code? Did you add the edit permission for the User Query API as well? I believe Query API permissions are the only permission needed for the scheduled batch job run. A server restart might help to identify if it is just cached. I'm doing a test as well to see if I can replicate the issue.

Thank you,
Gian

Posted by jsniemi79 on 19-Nov-2014 11:35

The batch code is in my first post.  The trigger is a create record trigger with a conversion map assigned.

I tried rebooting the server before I posted the thread to eliminate that issue.

Posted by Gian Torralba on 19-Nov-2014 11:54

Hello,

Sorry about the confusion. The edit permissions must be checked for the runTrigger API to run. "This API requires EDIT permission on the object record." Please see the runTrigger method usage in the Rollbase User Guide.

Let me know if this works,

Thank you,
Gian

Posted by jsniemi79 on 19-Nov-2014 13:43

That did it, thanks Gian!

This thread is closed