Question

FOREIGN KEY CONSTRAINT ERROR

​Hi all,

When I add up a new record in my Expense column, I encounter the error code 23503: insert or update on table "UsrExpense" violates foreign key constraint "FK6iJjNQPRI8nnDPoYK2UiQnK53Wo". 

Like 0

Like

5 comments
Best reply

Hello,



This error shows us that the system is trying to enter data into a certain column that does not exist or does not have the correct value. You need to check what the key you specified in the error refers to: "FK6iJjNQPRI8nnDPoYK2UiQnK53Wo". Make sure that the lookup that refers to the column has this value.  You can also open the browser console and view the insert data.

Hi 陳大鈞,



Could you please let us know if "UsrExpense" is a detail in a section? If it is a detail, can you try adding the expense after saving the main section record.

Hello,



This error shows us that the system is trying to enter data into a certain column that does not exist or does not have the correct value. You need to check what the key you specified in the error refers to: "FK6iJjNQPRI8nnDPoYK2UiQnK53Wo". Make sure that the lookup that refers to the column has this value.  You can also open the browser console and view the insert data.

Hi Malika,

 

I have already solved this problem, thank you for your help :) 

Hi Goparna Nasina,

 

I have already solved this problem, thank you for your help :) 

Jesus Parra,

Hello, 

The notification you have received occurs at the database level and means that the database cannot update the table due to invalid constraints. If you look at what this constraint is and what it is referring to, you can find what it refers to (in your case it's an UsrExpense object). It seems that the UsrExpense object was changed or related objects were changed (like adding new columns, removing columns/obects, editing column names, etc.), and this could be the reason of the issue you have faced. In this case to solve the issue please try to update the database structure where it is needed or additionaly before that run the source code generation and compile the system ("Compile All" option):

 

Also you can find the needed relation for the mentioned in the norification constraint by running the next query:

 

SELECT * FROM information_schema.constraint_column_usage WHERE constraint_name = 'FK6iJjNQPRI8nnDPoYK2UiQnK53Wo';

Regards,

Orkhan

Show all comments