What is the best way to populate a dropdown ?

I need the managers list while adding an employee . i have an employee and manager table . 

while creating an employee , i need to populate managers list so that HR can assign the manager to an employee . in the interface i need to populate the Manager dropdown .

 

Option 1 

 

--Create a query entity to fetch all the managers 

--get the data subset 

-- initialize local!managers:rule!getManagers()

and display like below  

a!dropdownField(
label: "Manager",
labelPosition: "ADJACENT",
placeholderLabel: "--- Select a Manager ---",
choiceLabels:{index(local!managers.data,"name")},
choiceValues:{index(local!managers.data,"name")},
value: ri!manager.name,
saveInto: ri!manager.id,
validations: {}
)

 

are there any better approach ?

  Discussion posts and replies are publicly visible

Parents
  • I dont understand the concept of storing in process model.  Wont the process have to retrieve the data first even before it can be passed to the UI and cause the UI delay in rendering anyway?

    Also dont understand where Josh says if the user opens the UI everytime, the local variable in the load function will be populated every time but isnt that the case with process model as well?  If the user closes and opens the UI again wont a new process model instance be created?

    I have a similar need for a pricing tool where I need to populate a dozen dropdowns with albeit very small data sets but I need to frequently look up multiple RATES tables based on the drop down values selected.  The RATES tables store records from about to 20 to 200 rows and I have about 10 of them!  ANY IDEAS?

  • 0
    Certified Lead Developer
    in reply to karthip0001

    In the case that a user is chained into a task from a related action then yes, there probably is not a speed up based on where you place your data load. If a task is assigned to a user (i.e. not from an action or related action) and/or a user continually saves and reopens a given task, there could be a speed up based on where you placed reference data loads. 

  • Thanks, that makes sense.  Unfortunately we don't assign tasks to any user yet.  These are pages that will display as part of the application the user has access to.

Reply Children
No Data