Check if every field has been filled in.

Check if every field has been filled in.

In my form I want to check if all fields are filled in and if so, set the value of a decision field (Info_compleet) to true. If there is any field that's empty, I want that Info_compleet to be set to false. Info_compleet, together with another decision field in the form (Productiestatus), should not be included in the check.

I managed to get this working the other way around using this code:
  1. if(input.Artikelnummer = null || input.Producent = null || input.Garantie = null || input.Productafbeelding = null || input.Sfeerafbeelding_1 = null || input.Sfeerafbeelding_2 = null || input.Sfeerafbeelding_3 = null || input.Beschrijving_ISAH = null || input.Beschrijving_productblad = null || input.Beschrijving_website = null || input.Armatuur_Hoogte = null || input.Armatuur_Breedte = null || input.Armatuur_Potmaat = null || input.Armatuur_Gewicht = null || input.Armatuur_Materiaal = null || input.Armatuur_Materiaal_onderstel = null || input.Armatuur_Materiaal_onderknoppen = null || input.Armatuur_Beglazing = null || input.Armatuur_Toepassing = null || input.Armatuur_Toepasbare_lichttechniek = null || input.Armatuur_eindkleur = null)
  2. {
  3. input.Info_compleet = false;
  4. }
  5. else
  6. {
  7. input.Info_compleet = true;
  8. }
I'm not the best at writing code, but I don't think this is the best way to do this.

I played around with getFieldNames() and removeElement to remove the two fields from the list, but I couldn't get that to work.

What would be the best way to do this?

    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方