The INSERT statement conflicted

Hi All,

after clicking save button i getting following error occurs

The INSERT statement conflicted with the FOREIGN KEY constraint "OSFRK_OSUSR_N2R_BANKDETAILS_OSUSR_N2R_CUSTOMERDETAILS_CUSTOMERID". The conflict occurred in database "RCIX3D008", table "dbo.OSUSR_N2R_CUSTOMERDETAILS", column 'ID'.

could anyone help me to solve this issue.

Thanks

Hi Sheetal,

You need confirm CustomerDetails entity have one foreign key so need to check this should have value when you insert other wise will get error.


Regards

Rahul

Solution

Hi Sheetal,

Based on the error, you have a relationship between your tables and the FK value (column: CustomerID)you are inserting is not in the "other table".

The entity u are trying to save a record into, has a mandatory field name CustomerID, the problem u are not providing this value "BankDetails" table

 Assign the value to the CustomerID attribute of the entity in the form record, before calling the CreateOrUpdate action when save data into the database. 


Vijay M-


Solution

hello Sheetal 

there are two things, either customerId does not exist in customer table or   as said in the above comments you are not passing the customerId  while create or update of customer details so please take a look at these things 

cheers

Thanks everyone for the response.

now is working.

Thanks

Sheetal