Support Topics Documentation Slack YouTube Blog

Save Objects In relation

Hello,
I am trying to save objects to the database in relation to another table.
(scenario ::>> i have a table with a list of vehicles, and a table called fuel requests.)

When a user selects the vehicle plate number, and fills in the fuel litres and presses the button "create order, i want to save the data to table fuel requests in relation to that vehicle selected.

This is the UI.
searching and selecting vehicle works fine. !

This is my codeless logic for now…I am stuck here (As it is, it saves the object to the database but it doesn’t create a relation to that vehicle. )

Stanoss

Hello, @stanoss_vebit.

Try this one:
image

Result:

Let us know if your issue has been resolved.

Best regards, Nikita.

  1. I have table ‘vehicles’ (with a list of vehicles).
  2. I also have table fuelRequest with nothing.(It has column litres)
    3)The relationship is 1:N (where one vehicle can have many fuel requests. The column of relationship is declared on table vehicles 1:N (relation name: fuel request )

Here is my UI


I want when a user selects the vehicle, and enters the litres, and clicks the button ‘create order’ i want that record to be saved to table ‘fuelRequest’ in relation to that vehicle he selected which is in the vehicles table.

so when I retrieve the record it should show me the the vehicle and litres it has taken.

Regards
Stanoss

This is roughly what you need. Each time add a new dependency (FuelRequest from Vehicles(1:N)).

Just plug in your values and everything should work as you described.

Best regards, Nikita.