I am creating an application that is used to simulate the basic banking actions such as deposit, withdraw and viewing transaction history. I am getting an error in my entity when i try to create a new user using the sign up screen which i have created. When i click on the submit button after entering the details this error pops up
"The INSERT statement conflicted with the FOREIGN KEY constraint "OSFRK_OSUSR_ZL4_CUSTOMER1_OSSYS_USER_ID". The conflict occurred in database "BXFBNW011", table "dbo.ossys_User", column 'ID'. The statement has been terminated." I am using the default User entity available in the system.
Customer's Id field is mapped to User's id and Transaction's Id is also mapped to User's id.
Can anyone please help.
First thing i notice is that you create the account before the user. So you don't use the created userid in your account record.
since the UserId is the primary key in all your entities, create the user first. The CreateUser has the created id as output. Put that as Id in your other record creations.
Furthermore:
You have multiple server actions in 1 client action. I would recommend to put all you logic in 1 server action.
Finally:
It's your datamodel but it does strike as odd that your transactions entity has a 1 on 1 relation with the user entity. You can never do more than 1 transaction?
You can also only have 1 account per user (which is less strange).
Are you sure you want 1 on 1 relations, or do you need 1 to many?
When you create a user, is your id empty? (nullidentifier())
Could you show the server action where you create the user?
Hi Akash ,
you need to first create User and after that you need to create Account number details with created used ID Because you have took One to One Relationship between User and AccountNumberDetail Entity.
Hope this will help you.
Regards
Rahul
Hello Akash,
If possible could you please share sample OML.
We will able to resolve it easily.
Regards,
Ajit Kurane.
Could you please have a look at it
I have updated your oml to create user. Rest thing you need to change from your side as already told by Rahul and Stefano.
Thanks,
I tried to implement your question with one to many relationship not with one to one relationship
Entity DiagramForm UI
AssignBefore User
Before Customer
Before IdProof
Data Saved / User CreatedCustomer data Saved Customer Created
User data Saved User Created
ThankyouAyush Khare