What is this error and how can I solve it ?
Question

I have employee table in one to one relationship to employeeimage  and employe tablee in one to many relationship with roles table

Screenshot (384).png

Ok, let 's start again. The second problem you have attached is that you are creating an EmployeeImage and in the field of EmployeeId you are inserting an Id that not exist.

I suggest you to make a screenshot of the function of create an EmployeeImage to see what exactly are you writing on the field EmployeeId. 

For example if you test to write "1" on the field of EmployeeId on the create function on the field of EmployeeID I am pretty sure that the function will be work.

Regards

this is what the aggregate shows . 

Screenshot (400).png

what do you mean by taking a screen shot  ? . sorry please help me this is all going over my head

Screenshot (403).png

ok the other issues got resloved . I expanded source inside createemployee and pass all aggregate attributes which we required . now i am facing some other problem which is i am getting 0 bytes for my binary data column

Hi, If you attached a screenshot of your database it will be easier to find the problem. However it seems that you are trying to insert to a table where you have a RoleId, an identifier which not exist. 

I mean you have your Roles table with:

1 Admin

2 Developer

And the table EmployeeWithRole:

EmployeeId

RoleId

If you try to insert 3 to RoleId to the table EmployeeWithRole, it will appear the error you have attached.

You can also make debugg and check what are you trying to insert to that field.


Regards


this is my employee entity with relationship of one to many with roles . 

Screenshot (388).png

Ok, so your are trying to insert to the table Employee2 a RoleId that not exist. Check your table of Roles, maybe is empty or check debuggin which value are you trying to insert to the field RoleId.

Regards

roles table has Id column. 

Screenshot (390).png

checked the employee table it is inserting two all values of roles table in employee table . is it suppose to be like this ?

Screenshot (392).png

I am getting this error now . 


the INSERT statement conflicted with the FOREIGN KEY constraint "OSFRK_OSUSR_ICE_EMPLOYEEIMAGE23_OSUSR_ICE_EMPLOYEE22_ID". The conflict occurred in database "ON4OEO000", table "dbo.OSUSR_ICE_EMPLOYEE22", column 'ID'. The statement has been terminated.

sound like you are trying to insert to EmployeeImage entity with the id that is not in the Employee entity 

Thanks and best regards

But i have a one to one relationship between employee table and eamployeeimage table . so every employeeimage has a employee

Sure but the ID is not correct, make a screenshot of the create function please

I create a button on screen and put my create function in the flow

Ok, let 's start again. The second problem you have attached is that you are creating an EmployeeImage and in the field of EmployeeId you are inserting an Id that not exist.

I suggest you to make a screenshot of the function of create an EmployeeImage to see what exactly are you writing on the field EmployeeId. 

For example if you test to write "1" on the field of EmployeeId on the create function on the field of EmployeeID I am pretty sure that the function will be work.

Regards

this is what the aggregate shows . 

Screenshot (400).png

what do you mean by taking a screen shot  ? . sorry please help me this is all going over my head

Screenshot (403).png

ok the other issues got resloved . I expanded source inside createemployee and pass all aggregate attributes which we required . now i am facing some other problem which is i am getting 0 bytes for my binary data column

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