25
Views
5
Comments
Solved
Form Validations
Question
Application Type
Reactive
Service Studio Version
11.54.59 (Build 63275)

Hi everyone , 

i'm new to the outsystems i'm building a Employee Directory project , in that when i tried to built a form validations for phone number i'm facing this error.

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

https://personal-vwse1mdx.outsystemscloud.com/EmployeeDirectory/EmployeeDetails?EmployeeId=0


Screenshot 2024-05-15 153638.png
EmployeeDirectory.oml
2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello

I see the issue was you are not assigning the created, user id while creating a record

So on the image Create update action Null is being passed

Since the employee you are creating you are passing Employee details From the input parameter "Employee" to your CreateOrUpdateEmployee and at the same time you have null inside the Id  on your input, so since it is been passed to CreateOrUpdateEmployPicture you need to assign a id of an employee which is been created.












I am attaching a fix here hope this help.

Thanks
Tousif Khan

EmployeeDirectory_Updated.oml
2023-10-21 19-42-11
Tousif Khan
Champion

Hello

I see the issue is related to foreign key, as it says There might be some assignment which is missing or the Id which we are assigning dosent exist.

if you can attach the Oml we can demonstrate it and fix it and see what is missing here.

Thanks
Tousif Khan 

UserImage.jpg
jayakrishnasai Korikana

Hi @Tousif Khan  , thanks for responding i'm sharing the oml file here .

EmployeeDirectory.oml
2023-10-21 19-42-11
Tousif Khan
Champion
Solution

Hello

I see the issue was you are not assigning the created, user id while creating a record

So on the image Create update action Null is being passed

Since the employee you are creating you are passing Employee details From the input parameter "Employee" to your CreateOrUpdateEmployee and at the same time you have null inside the Id  on your input, so since it is been passed to CreateOrUpdateEmployPicture you need to assign a id of an employee which is been created.












I am attaching a fix here hope this help.

Thanks
Tousif Khan

EmployeeDirectory_Updated.oml
UserImage.jpg
jayakrishnasai Korikana
2023-10-21 19-42-11
Tousif Khan
Champion

Your Welcome :)
Glad to help you with this
Tousif Khan

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