Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Attiyah Farid
29
Views
2
Comments
Solved
Delete not working
Question
Usability
We are creating a benchmarking survey, which requires admin user to create a survey (by selecting from a list of questions they want to include). This generates a version of the survey which is then completed by the user.
We have a list of surveys page with a delete action, however when we publish the application, an error message appears when we try and delete a version, which says :
The DELETE statement conflicted with the REFERENCE constraint "OSFRK_OSUSR_919_SURVEYRESULTS_OSUSR_919_SURVEYQUESTION_SURVEYQUESTIONID". The conflict occurred in database "OUTSYSTEMS", table "dbo.OSUSR_919_SURVEYRESULTS", column 'SURVEYQUESTIONID'. The statement has been terminated.
Can anyone guide us on how to correct this error?
Thanks
João Rosado
Staff
Solution
Hi Attiyah,
The error tells you what are the entities/columns with issues.
You are trying to delete a SURVEYQUESTION but you have a records in SURVEYRESULTS that references it.
The SURVEYRESULTS.SURVEYQUESTIONID has a "Delete Rule" set to "Protect" causing the exception.
If you want the results to be automatically deleted when a question is deleted then you should change the "Delete Rule" property of the SurveyQuestionId from "Protect" to "Delete":
Regards,
João Rosado
See solution in context
Gerry
Is there a child record you need to delete first?
João Rosado
Staff
Solution
Hi Attiyah,
The error tells you what are the entities/columns with issues.
You are trying to delete a SURVEYQUESTION but you have a records in SURVEYRESULTS that references it.
The SURVEYRESULTS.SURVEYQUESTIONID has a "Delete Rule" set to "Protect" causing the exception.
If you want the results to be automatically deleted when a question is deleted then you should change the "Delete Rule" property of the SurveyQuestionId from "Protect" to "Delete":
Regards,
João Rosado
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...