When creating Campaign get - Error retrieving record. This record may be deleted or you may not be authorized to view it.

Hi Everyone

Just discovered the awesome campaign, survey and newsletter functions in SuiteCRM.

Creating a test survey to go via a campaign. Unfortunately when I get to the email template section it says

“Error retrieving record. This record may be deleted or you may not be authorized to view it.”

I cannot locate any fatal errors in my logs.

Anyone know of a solution for this?

Thank you


Hi Everyone

I found the following Sugar CRM guide it listed a number of potential solutions. If you have a similar problem may run through them (mostly to do with hidden modules in Admin tab and then User Profile tab, plus access)


It didn’t help me, but is related!

The search continues!


Try to browse your templates from the “Email templates” module, instead of doing it from inside the Campaign Wizard.

1 Like

Oops found what looks like an error code in my log!

Tue Sep 11 09:25:20 2018 [1799][1][FATAL] Exception handling in /var/www/html/include/MVC/Controller/SugarController.php:402
Tue Sep 11 09:25:20 2018 [1799][1][FATAL] Exception in Controller: Error retrieving record. This record may be deleted or you may not be authorized to view it.
Tue Sep 11 09:25:20 2018 [1799][1][FATAL] backtrace:
#0 /var/www/html/modules/Campaigns/WizardMarketing.php(69): sugar_die(‘Error retrievin…’)
#1 /var/www/html/include/MVC/View/SugarView.php(840): include_once(’/var/www/html/m…’)
#2 /var/www/html/modules/Campaigns/views/view.classic.php(77): SugarView->includeClassicFile(‘modules/Campaig…’)
#3 /var/www/html/include/MVC/View/SugarView.php(207): CampaignsViewClassic->display()
#4 /var/www/html/include/MVC/Controller/SugarController.php(432): SugarView->process()
#5 /var/www/html/include/MVC/Controller/SugarController.php(375): SugarController->processView()
#6 /var/www/html/include/MVC/SugarApplication.php(109): SugarController->execute()
#7 /var/www/html/index.php(52): SugarApplication->execute()
#8 {main}

Still trying to figure out what the problem is, I am admin user so can’t seem to tweak it!

Hi pgr,

I can access the email templates using browse, I have created and edited some. When I m creating a campaign when I get to the template section the URL bar states:

The page sayes:
“Error retrieving record. This record may be deleted or you may not be authorized to view it.”

I cannot create any campaigns!


FYI when I tried the same thing in my Bitnami Server (I have a bitnami and a Linux) I get the same error when attempting to create a campaign… so doubt it is a permissions issue.

I have tried looking at the code, but I don’t know which section I should be looking at and what to compare it to.


This didn’t work for me but may be a solution if others encounter it.

This has a similar error code in Sugar and goes through some things that may be helpful, like change the role to owner and some more.


I’m still trucking on to find a solution, hope the link above might help someone in future.


If you didn’t play with Security Settings before (Roles / Security Groups / etc) I don’t think that is the kind of access problem you’re getting.

I find your URL up there very suspicious, the “ids” are empty. No wonder it can’t retrieve the record.

So I’d say the bug or problem is before that, when that URL is generated (basically, in the code in the button right before that URL appeared)

EDIT: one more thing: don’t you have any more messages in the log, right before that FATAL? You can increase your log level in Admin / System Settings, to Warning (at least). This should give you more clues.

1 Like

Hi pgr

I changed the error log to warning and found the following error warning.

Wed Sep 12 13:58:01 2018 [9414][-none-][WARN] Configuration variable date.timezone is not set, guessed timezone UTC. Please set date.timezone="UTC" in php.ini!

So I went and changed it to “UTC” in php.ini

That warning code has cleared but now I receive the following when the job fails.

Wed Sep 12 13:58:01 2018 [9414][1][DEPRECATED] Formatting correction: SchedulersJobs->execute_time had formatting automatically corrected. This will be removed in the future, please upgrade your external code
Wed Sep 12 13:58:01 2018 [9414][1][DEPRECATED] SugarBean.php: preprocess_fields_on_save() is deprecated
Wed Sep 12 13:58:01 2018 [9414][1][DEPRECATED] SugarBean.php: preprocess_fields_on_save() is deprecated

I feel so close to getting this done, but so far away!


This is the code I am getting on the button prior to clicking to templates when in campaigns.

<input id="wiz_submit_button" class="button" onclick="this.form.action.value='WizardNewsletterSave';this.form.direction.value='continue';/* gatherTrackers(); */" acceskey="Save" type="submit" name="button" value="Next">

<input id="wiz_submit_finish_button" class="button" onclick="this.form.action.value='WizardNewsletterSave';this.form.direction.value='exit'; gatherTrackers(); " acceskey="Save" type="submit" name="button" value="Next" style="display: none;">

This error code still appears after I click through.

Error retrieving record. This record may be deleted or you may not be authorized to view it.

Below still shows in the address bar.


I can’t reproduce your issue, and debugging your system from here is impossible :slight_smile:

I don’t know, try restarting from scratch - delete all Email Templates, then create a new one. Make sure it works (send a single email with it, not from a campaign).

Then delete all Campaigns and start a new one to see if it works. If not, maybe try a fresh install if that is an option for you?

Hi pgr,

It certainly would be impossible! I tried you email solution, no luck. I can’t do a reinstall at present (but I am looking into it), but I do have the same issue with my separate bitnami server, so I am little worried it may be endemic and I would re-encounter it.

I checked the demo SuiteCRM and created a campaign, got the following URL when I clicked it. Looks like mine is not creating the ID codes when I am clicking the next button.

Demo SuiteCRM


On mine I do not get the return ID’s


I have noticed until you get the the templates section no IDs are created on the demo, so I believe it is an ID creation issue.

What I am doing now is looking for what element might cause it to not correctly create the ID’s for the newsletter and marketing campaigns.

I am thinking either:

  1. Permissions
  2. SQL error not allowing access
  3. Error in one of my php.ini files

Anyone got any thoughts?


Hi All

I have been clearing error codes and now think I have found the final one.

Thu Sep 13 14:38:20 2018 [10277][1][WARN] Failed to load relationship survey while saving Campaigns
Thu Sep 13 14:38:20 2018 [10277][1][DEPRECATED] SugarBean.php: preprocess_fields_on_save() is deprecated
Thu Sep 13 14:38:20 2018 [10277][1][FATAL] Mysqli_query failed.
Thu Sep 13 14:38:20 2018 [10277][1][FATAL] Error inserting into table: campaigns: Query Failed: INSERT INTO campaigns (id,name,date_entered,date_modified,modified_user_id,created_by,deleted,assigned_user_id,tracker_count,refer_url,end_date,status,impressions,currency_id,campaign_type,frequency,survey_id)
					VALUES ('31dc8687-7ffc-d655-8c93-5b9a7694cf74','BRoadback','2018-09-13 14:38:20','2018-09-13 14:38:20','1','1',0,'1',0,'http://',NULL,'Planning',0,'6ca233cb-3b48-ca1a-74e4-5b6452303cbe','Survey','','24d83cd7-1b0c-ec57-8d43-5b9781938613'): MySQL error 1364: Field 'tracker_key' doesn't have a default value

So need the field tracker key.


Hi All

Solution appears here (thanks pgr)


and more detail on Github here:


Solution in SQL is “(only) flag you need to remove from sql_mode is NO_ZERO_DATE.”

I am a complete N00b so I will list out the instructions on how to do that when I find them in case anyone has same issue in future!

Thanks All

Solved this by logging into my sql monitor and typing:


The kooky thing is mysql monitor admin and my SSH loinux admin are both called root, so you will need 2 different passwords to get, to log in.

mysql --user="root" --password='YOURSQLADMINPASSWORD'

To clarify ROOT for admin in you SSH is different from ROOT admin in SQL.

Hope that helps!


1 Like

Check values:

SHOW variables WHERE variable_name = ‘sql_mode’;

Set values: