Using dropdown append and add functions on a dropdown field inside a dynamically generated subform row
Greetings
i'm working on a subform where i will create rows dynamically and assign them values on form load. i also want to assign choices dynamically to the dropdown menus of each generated row.
the issue is when i try to access the :ui of the dynamically generated row i get that the row name variable i'm using is null! despite that i was using it in the previous line with no issues!
here is how my code looks, what can i do to achieve what i need?
- row1 = Add_Employee.Earnings();
- x = New_Earning[Earning_Type == id];
- row1.SALARY_COMPONENTS=x.ID;
- ear_typ = New_Earning[ID == row1.SALARY_COMPONENTS].Earning_Type;
- //i try here to add the choices list to the dropdown component
- row1.COMPONENTS_DROPDOWN:ui.add(New_Earning[Earning_Type == ear_typ].ID.getAll());
-
- if(x.Calculation_Type == "Flat Amount")
- {
- row1.MONTHLY_AMOUNT=x.Enter_Amount;
- row1.ANNUAL_AMOUNT=x.Enter_Amount * 12;
- row1.Calculation_Type="Fixed amount";
- }
- else
- {
- row1.Calculation_Type=x.Percentage + " %";
- }
- //everything else works correctly and i can successfully assign values to dynamic fields
- input.Earnings.insert(row1);
thanks