14
Views
10
Comments
Solved
Error creating Email. The INSERT statement conflicted with the FOREIGN KEY
Question
Platform Version
11.8.1 (Build 15399)

Hi guys,

I´m trying to send email by my application On-Premisse and I get this error

Error creating Email. The INSERT statement conflicted with the FOREIGN KEY constraint "OSFRK_OSSYS_EMAIL_STATUS_OSSYS_EMAIL_ID". The conflict occurred in database "outsystems", table "dbo.OSSYS_EMAIL", column 'ID'.
The statement has been terminated.

Can anyone help me?

Rank: #745
Solution

Hey guys,

Problem solved.

There was a problem in Deployment Zone. The Deployment Zone Address was incorrect, it had a wrong IP so the connection could no be made. The error log is not accurate, but I found another ("Error creating Email. The remote server returned an error: (404) Not Found. ") So by that I been able to solve this.

Thank you all.


Rank: #300

Hi Evan,

This error means that you are trying to create a record in the entity, but looks like the entity has a mandatory Foreign Key that is not being provided, or the value provided does not match one in that entity. 

Could you please share the OML, if possible to look into the issue?

Thanks & Kind Regards,

Sachin

Champion
Rank: #209

Hi Evan,

You're trying to insert a database record that has a null value on a mandatory field. Can you please share screenshot of your logic or share oml to do more investigation.

Regards

Shashikant Shukla 

Rank: #745

Hi,

This is de Email Component, I have no control on it...

Hi Ivan,

Good evening!

This is a bit puzzling since those tables are Outsystems entities. I was looking for a platform version release note addressing to such but didn't find one. Since this is on-premise, I think it's best if you refer this to Outsystems support, not unless there is some sort of configuration in the factory/service center that needs to be set. Or provide first the OML as requested by Sachin and Sashikat.

Thank you and kind regards,

Chris

Rank: #745

Yes the email configurations are done and ok. They are the same in Dev environment.

Hi Ivan,

Kindly refer to this post, this might be similar to your concern and the logic you have implemented.

https://www.outsystems.com/forums/discussion/47312/send-email-is-transaction/

Hope this helps.

Kind regards,

Chris

Rank: #287

HI  Ivan

Can you tell me When does the error message appears?

Is it during development, or when you send the email?

Kind Regards


Rank: #287

Hi Evan,

Judged by your error message, I assume you have a EMAIL_STATUS Entity and has a column reference to Email Entity's Id. But when you create the EMAIL_STATUS  record you didn't provide the correct Email Id.

Could you please share the OML or some screenshot?

Kind Regards

Rank: #245

The table you are referring to is this one:

'Email_Status'


Status of each "Email Sent". Used to synchronize the mail dispatch process inside the OutSystems Scheduler service between multiple Servers.

It has these fields:


since the errormessage tells us you have a error in a constraint in column ID, my guess would be that the table somehow got corrupt. 


Can you send emails from other applications and templates or will they raise the same error?


Your environment is on premise but i guess you can still send in a ticket for Outsystems Support?

Rank: #745
Solution

Hey guys,

Problem solved.

There was a problem in Deployment Zone. The Deployment Zone Address was incorrect, it had a wrong IP so the connection could no be made. The error log is not accurate, but I found another ("Error creating Email. The remote server returned an error: (404) Not Found. ") So by that I been able to solve this.

Thank you all.