The INSERT statement conflicted with the FOREIGN KEY constraint

Hi,

I want to save some dropdowns selections in an entity. The dropdowns are associated with static entities. All the selected values are to be gathered in a single entity and based on records different actions are taken. Now, while saving the dropdown selected values, I am getting the below error.

I referred many questions on forum like such but couldn't understand how to rectify this. 

I'll be grateful if someone gives an idea of how to rectify this and also the best way to store dropdown selections in a table.

Hello Simran,

This is because ,If you are not providing a value for an FK, OutSystems will check if the FK is mandatory or not. If it is mandatory, OutSystems will provide a default value: 0. Assuming the entity Person has an identifier Auto-number, their ids start at 1, hence the error from database

Check that you are passing the correct FK

Thanks and Regards,

Akshay Deshpande

Hello Simran,

This is because ,If you are not providing a value for an FK, OutSystems will check if the FK is mandatory or not. If it is mandatory, OutSystems will provide a default value: 0. Assuming the entity Person has an identifier Auto-number, their ids start at 1, hence the error from database

Check that you are passing the correct FK

Thanks and Regards,

Akshay Deshpande

Hi @Deepa Tiwari and @Akshay Deshpande šŸš€ , thank you for your responses. This helped me. The issue is resolved!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.