locked
How to Assign values to ComboBox dynamically? RRS feed

  • Question

  •  

    Hi,

     

    I have a particular scenario where a user 'Manager' should get Names of Employees that are reporting to him. And based on the selection of the Employee Name in the combo box I shall be displaying all records related to him in a grid below the combo box.

     

    My doubts are :

     

    1. I am able to filter DataSource based on ManagerId, but how to assign EmployeeId column of the filtered DataSource to the Combo Box?

    2. Is there any other approach in Dynamics other than combo box selection?

    Friday, December 26, 2008 6:31 AM

Answers

  • Hi Viddi,

    As your employee entity will probably be somewhat dynamic (i.e. employees's come and go), a MS CRM picklist may not be the way to go. You may want to create a manager/employee entity. (BTW, you may want to look at doing this using MS CRM users as they can specify a manager).

    Anyway, the manager and employee picklist as well as datagrid may need to reside on a custom aspx form to achieve your objective, however your solution depends on where you want to display this form. I.E if from the 'managers' entity, you don't need to display the manager's picklist. You could also look into dynamic picklists to determine the list of employees to display and then based on that selection, create some JS which updates the IFRAME (datagrid).

    Personally I would recommend just displaying a custom ASPX form with a list of employees in the picklist and datagrid below. Assuming you're reading from from the 'managers' form, you can retrieve the managers GUID from the querystring and populate the employee's picklist as you see fit.

    Cheers,

    Karlo


    Saturday, December 27, 2008 8:52 AM