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?