how to value local variable save to database

hi,

i have dropdown and variable set to local variable, but if click save value not saved in database, how to value local variable save to database?..

Hi Ahmad Zaenal Awaludin,

Can you show the screenshot of the action SaveOnClick? You have to set a CreateOrUpdate Entity action to store the selected dropdown value. The selected dropdown value stored in the Local Variable would  Room.Id as you have set Value of the dropdown as Room.Id.


Regards,

Manthan Shah.

Hi Ahmad,

You don't need to use a local variable.
You should use your RoomId foreign key from the booking entity.

If you really need to use a local variable, you should set record's RoomId foreign key from your local variable before you save.

With best regards,
F.Karatay

Manthan Shah wrote:

Hi Ahmad Zaenal Awaludin,

Can you show the screenshot of the action SaveOnClick? You have to set a CreateOrUpdate Entity action to store the selected dropdown value. The selected dropdown value stored in the Local Variable would  Room.Id as you have set Value of the dropdown as Room.Id.


Regards,

Manthan Shah.

Hi Manthan below screenshot action save on click

i have condition check room booking or not by RoomId local variable, and if room not booking iwant to save Roomid local variable to database

Ferhat Karatay wrote:

Hi Ahmad,

You don't need to use a local variable.
You should use your RoomId foreign key from the booking entity.

If you really need to use a local variable, you should set record's RoomId foreign key from your local variable before you save.

With best regards,
F.Karatay

Hi Ferhat

any tutorial for set record's RoomId foreign key from local variable 


Ahmad Zaenal Awaludin wrote:

Manthan Shah wrote:

Hi Ahmad Zaenal Awaludin,

Can you show the screenshot of the action SaveOnClick? You have to set a CreateOrUpdate Entity action to store the selected dropdown value. The selected dropdown value stored in the Local Variable would  Room.Id as you have set Value of the dropdown as Room.Id.


Regards,

Manthan Shah.

Hi Manthan below screenshot action save on click

i have condition check room booking or not by RoomId local variable, and if room not booking iwant to save Roomid local variable to database

Use the aggregate of Room Entity and assign a filter to it like Room.Id = RoomId(Local Variable) . Hope this helps.


Manthan Shah wrote:

Ahmad Zaenal Awaludin wrote:

Manthan Shah wrote:

Hi Ahmad Zaenal Awaludin,

Can you show the screenshot of the action SaveOnClick? You have to set a CreateOrUpdate Entity action to store the selected dropdown value. The selected dropdown value stored in the Local Variable would  Room.Id as you have set Value of the dropdown as Room.Id.


Regards,

Manthan Shah.

Hi Manthan below screenshot action save on click

i have condition check room booking or not by RoomId local variable, and if room not booking iwant to save Roomid local variable to database

Use the aggregate of Room Entity and assign a filter to it like Room.Id = RoomId(Local Variable) . Hope this helps.

oke this no problem, problem is RoomId(Local Variable) not save to database. and i confuse

Ahmad Zaenal Awaludin wrote:

Ferhat Karatay wrote:

Hi Ahmad,

You don't need to use a local variable.
You should use your RoomId foreign key from the booking entity.

If you really need to use a local variable, you should set record's RoomId foreign key from your local variable before you save.

With best regards,
F.Karatay

Hi Ferhat

any tutorial for set record's RoomId foreign key from local variable 


Hi Ahmad,

You can download an example here; https://we.tl/t-nWp2EnnPXn
However, I also strongly suggest you watch learn materials. They are very useful to learn.

With best regards,
F.Karatay

Ahmad Zaenal Awaludin wrote:

Manthan Shah wrote:

Ahmad Zaenal Awaludin wrote:

Manthan Shah wrote:

Hi Ahmad Zaenal Awaludin,

Can you show the screenshot of the action SaveOnClick? You have to set a CreateOrUpdate Entity action to store the selected dropdown value. The selected dropdown value stored in the Local Variable would  Room.Id as you have set Value of the dropdown as Room.Id.


Regards,

Manthan Shah.

Hi Manthan below screenshot action save on click

i have condition check room booking or not by RoomId local variable, and if room not booking iwant to save Roomid local variable to database

Use the aggregate of Room Entity and assign a filter to it like Room.Id = RoomId(Local Variable) . Hope this helps.

oke this no problem, problem is RoomId(Local Variable) not save to database. and i confuse

Did you put the aggregate as I told with the filter ? and In the Create and Update action in RoomId(Column of the entity)  put the aggregate's Id in it. This will save your room id.


Ferhat Karatay wrote:

Ahmad Zaenal Awaludin wrote:

Ferhat Karatay wrote:

Hi Ahmad,

You don't need to use a local variable.
You should use your RoomId foreign key from the booking entity.

If you really need to use a local variable, you should set record's RoomId foreign key from your local variable before you save.

With best regards,
F.Karatay

Hi Ferhat

any tutorial for set record's RoomId foreign key from local variable 


Hi Ahmad,

You can download an example here; https://we.tl/t-nWp2EnnPXn
However, I also strongly suggest you watch learn materials. They are very useful to learn.

With best regards,
F.Karatay

Hi Ferhat,

oke, then from the example how to check if the room has been booked or not before save?..

Hi Ahmad,

  1. Create an action in your logic tab for instance; CheckRoomAvailable
  2. Set input parameters RoomId, StartDate, EndDate and Output parameter IsAvailable
  3. In your action check from the database your room available or not
  4. Set output parameter
  5. Call that action in your save action and check result

    For instance;
    For the best performance; you can put all your logic in a single action and you can call that action in save button. Also, I strongly suggest you study learning materials.

    With best regards,
    F.Karatay

Ferhat Karatay wrote:

Hi Ahmad,

  1. Create an action in your logic tab for instance; CheckRoomAvailable
  2. Set input parameters RoomId, StartDate, EndDate and Output parameter IsAvailable
  3. In your action check from the database your room available or not
  4. Set output parameter
  5. Call that action in your save action and check result

    For instance;
    For the best performance; you can put all your logic in a single action and you can call that action in save button. Also, I strongly suggest you study learning materials.

    With best regards,
    F.Karatay

hi ferhat,

can i get example.oml for this tutorial?.. thanks


Solution

Hi,

You can find in the attachment.


With best regards,
F.Karatay

Solution

Ferhat Karatay wrote:

Hi,

You can find in the attachment.


With best regards,
F.Karatay

oke thanks ferhat.