You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Access Denied! when trying to delete records from an object

Received Response
18
Views
8
Comments
edited Mar 31, 2021 12:53PM in Customer Portal 8 comments

Content

Hi,

I am trying to delete data from a custom object. However when executing, I get an error:

Access Denied!

My profile has permissions to delete from this object. I've included the code I'm using. As I said, I have the permissions on a profile level and an object level.

Any suggestions?

Version

Latest

Code Snippet

	private function deleteOldEstablishmentData() {
		RNCPHP\ConnectAPI::getCurrentContext()->ApplicationContext = "Delete old establishment data"; 
		$query = "DELETE FROM Misc.establishment WHERE UpdatedTime < '".date("Y-m-d")."' LIMIT 1000";
		$roql_rs = RNCPHP\ROQL::query($query);
		RNCPHP\ConnectAPI::commit();
		return true;
	}

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!