21
Views
11
Comments
Solved
Room Service Booking Assigments eror
Question

Why its when press request button it says "The INSERT statement conflicted with the FOREIGN KEY constraint "OSFRK_OSUSR_OCK_ROOMSERVICE_OSUSR_OCK_ROOMSERVICETYPE_ROOMSERVICETYPE". The conflict occurred in database "HHWW7G029", table "dbo.OSUSR_OCK_ROOMSERVICETYPE", column 'ID'. The statement has been terminated. "

did you know why this?

Bookingsrobby.oml

Rank: #97
Solution

Hi Robbie,


Please refer to the attached updated OML.


Hope this helps you.


Cheers,

João

Bookingsrobby.oml

mvp_badge
MVP
Rank: #19

Hi Robbie Chandra,

I haven't opened your module, but from the message, you are trying to write (Create or Update) a RoomService record without assigning it a RoomServiceType.

Hope this helps!

Hi Robbie,


  I took a look at your attachment, there I can see in the request action the roomServiceType is not assigned,

Which is set mandatory property as yes in entity. Either we can set the mandatory property as no in entity or we could assign proper value before calling create or update action.

Regards!

Suriya

mvp_badge
MVP
Rank: #90

Hi Robbie,

After checking the shared .oml file, I observed that the RoomService Form's Source Record is mapped with RoomService record type local variable. 

The included RoomService Type Dropdown Widget and also the Room_Service_Amount2  input widget variable is mapped with the RoomService Record type local variable attributes instead it should be mapped with the Form runtime record attribute placeholders which is in actual mapped with the CreateOrUpdateRoomService Entity action. Because of this very reason the passed RoomServiceId is getting null value when inserting the record in RoomService table which leads to DB exception...

Please change the variable mapping of both the widgets as shown below

Please refer  the attached .oml file


Hope this helps you!


Regards,

Benjith Sam

Bookingsrobby.oml

Rank: #97
Solution

Hi Robbie,


Please refer to the attached updated OML.


Hope this helps you.


Cheers,

João

Bookingsrobby.oml