23
Views
4
Comments
Issues in updating a record - Wrong records gets updated
Question

I'm facing an issue with updating user data in my application. When I create a new user, I assign them a unique EmployeeID, and this EmployeeID serves as the primary identifier for each user. However, when I attempt to update a user's data by specifying their EmployeeID, the update is being applied to the wrong record in the database, regardless of the provided EmployeeID.

Champion

Hi,

Most probably wrong value of EmployeeId is getting passed while updating the record. Are you assigning EmployeeId manually or its on auto increment. It will be helpful if you can share some screenshot of code and entity or i would suggest debug the logic end to end to check where missing.

regards

Hello Mugundhan 

As @Vikas Sharma said, you are probably trying to update a specific user with the EmployeeId from other record.

Can you share more information about it?

Did you try to the debug and confirm if the employeeId you send to update the user record, is the correct one?

Hi Mugundhan,

OutSysems User data lives in the System User entity, which does not contain an EmployeeID. So where do you store the EmployeeID?

Apart from that, your problem sounds really easy to find by debugging. Did you debug your application? I assume there's an aggregate that retrieves the user record based on EmployeeID. What is the output? And what record are you updating?

Hi Kilian Hekhuis,

I am facing an issue when I try to add a new document in one entity with the primary key of another table. The document is not created as new its just updating the existing one. and also i have attached my oml file for your reference.

Thanks and regards,
Mugundhan

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