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

mvp_badge
MVP
Solution

Hi Robbie,


Please refer to the attached updated OML.


Hope this helps you.


Cheers,

João

Bookingsrobby.oml

João Marques wrote:

Hi Robbie,


Please refer to the attached updated OML.


Hope this helps you.


Cheers,

João

 

 Thanks.

its erorr was clear. but why when i press request the room service type not inputed?

mvp_badge
MVP

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!

Jorge Martins wrote:

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!

 

 So i should create a new variable or replace Booking id for RoomServiceType?

Jorge Martins wrote:

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!

 But its still same error when i added RoomServiceType

 

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

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

Benjith Sam wrote:

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

 I did what you suggested but it's still error

mvp_badge
MVP
Solution

Hi Robbie,


Please refer to the attached updated OML.


Hope this helps you.


Cheers,

João

Bookingsrobby.oml

João Marques wrote:

Hi Robbie,


Please refer to the attached updated OML.


Hope this helps you.


Cheers,

João

 

 Thanks.

its erorr was clear. but why when i press request the room service type not inputed?

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