Database

Hi guys,

I am saving department and designation id into database .how to save its name instead of ids into database.

So that on UI i can show name of  department and designation instead of ids.

Hello Rohan Roy,

Step 1. Department and Designation datatype should be set to Text in the entity.

Step 2. Change Dropdown Options value from Department_mst.Id to Department_mst.Deptname.

Same thing for designation.


Thus, you can achieve your task.


As per best practice, 

You should save Id's on the table, same as what you are doing currently.

While fetching the result, you can join two entities using these Id's to get the Name.


Kind Regards,

Riyaz

mvp_badge
MVP

What you need to share is the logic attached to the save button, especially the mapping of data that you write to thhe entity.

Hey Rohan Roy,

If you want to save the name on the database, you just have to add that attribute to your entity, have that as your variable on the dropdown widget, and then select the name attribute on the 'options value'.

Hope this helps

Hello Rohan Roy,

Step 1. Department and Designation datatype should be set to Text in the entity.

Step 2. Change Dropdown Options value from Department_mst.Id to Department_mst.Deptname.

Same thing for designation.


Thus, you can achieve your task.


As per best practice, 

You should save Id's on the table, same as what you are doing currently.

While fetching the result, you can join two entities using these Id's to get the Name.


Kind Regards,

Riyaz

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