Using dropdown append and add functions on a dropdown field inside a dynamically generated subform row

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?


  1. row1 = Add_Employee.Earnings();
  2. x = New_Earning[Earning_Type == id];
  3. row1.SALARY_COMPONENTS=x.ID;

  4. ear_typ = New_Earning[ID == row1.SALARY_COMPONENTS].Earning_Type;
  5.         //i try here to add the choices list to the dropdown component
  6. row1.COMPONENTS_DROPDOWN:ui.add(New_Earning[Earning_Type == ear_typ].ID.getAll());

  7.        if(x.Calculation_Type == "Flat Amount")
  8. {
  9. row1.MONTHLY_AMOUNT=x.Enter_Amount;
  10. row1.ANNUAL_AMOUNT=x.Enter_Amount * 12;
  11. row1.Calculation_Type="Fixed amount";
  12. }
  13. else
  14. {
  15. row1.Calculation_Type=x.Percentage + " %";
  16. }
  17.         //everything else works correctly and i can successfully assign values to dynamic fields
  18. input.Earnings.insert(row1);

thanks

    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now