Forum Discussion

Alexis_Amirtharaj's avatar
8 years ago

Dynamic setting of data source

Hi, I have a query regading data source attribute of Item Dropdown field of a form. Is it possible to set the data source (Item Type) of a dropdown (field type as item) dynamically/programmatically? Can you let me know how I can achieve this? I would like dynamically set the attribute of a field - a dropdown box of field type 'item' to a particular Item Type based on different selections of the user. Can you please provide a way to achieve this dynamic setting of data source attribute of dropdown box of field type 'item'?   Alexis.

6 Replies

  • In other words, I am trying to find out how to rebind a dropdown to different item types using javascript based on the grid row that's selected. I am thinking of dynamically loading a form with an item dropdown control with different data sources as a solution. Please also let me if there's a way of achieving this using table/grid view. If so, how I can achieve this, please?
  • Hi Alexis, the chapter "Dynamically Populate Dropdown" in this article is maybe a good start for this usecase: community.aras.com/.../ I do something similar here: github.com/.../cui-select-starting-page In both sample static lists are used. It should be possible to dynamically chose the target List for the dropdown accoring to the dropdown list used in the ItemTypes.
  • Hi, Thank you for your quick reply with solutions in this context. While I will take a closer look into your suggestions, I would also like to add more clarity to my query. I am not trying to create a list for the dropdown box. I am using the dropdown box with the field type of 'item' which allows me to pick an item and assign it to the same field. For example, let's say I have the following items on a grid with four columns (Name of the attribute, Value as a string value, Data type, Data source if applicable) 'A'    <value>    'item'    'user' 'B'      <value>   'string' 'C'      <value>   'item'     'order' So, when the user selects 'Show instance' on Row A, the form would have a dropdown box of type 'item' and data source 'user' (which is an item type). And when the user selects  'Show instance' on Row C, the form would have a dropdown box of type 'item' and data source 'order' (which is an item type). Many thanks for your support. Alexis.
  • Two more points to clarify my previous message.
    1. 'Show instance' in my previous message means a mechanism to show the form related to that grid (relationship tab).
    2. Clicking on the three dots on the dropdown box opens up the search dialog with options to select an item.
  • So you don´t want to create a dynamic dropdown, but a dynamic search dialog? This sample also contains code of how to call a search dialog: github.com/.../custom-modal-dialog The search dialog used in the sample is static. But I think it´s possible to pass some arguments.
  • Hi, You have understood my query very well. Thank you for providing links to solutions that are close to what I was looking for. I could achieve my goal with the help of the solutions from the page: http://community.aras.com/fr/forums/topic/dont-close-the-searchdialog/ Using the solution provided on the above page, I could build a dynamic search solution by providing different parameters (different types of items), allowing the users to dynamically search for items and update them for later use. With regards, Alexis.