0

Submit button with required fields notification.

Hi, I have a very limited knowledge when it comes to writing scripts so please consider this when answering. I have form for managers where they have to fill up information about sales and production every day. There is about 20 fields in a form and all are required. I have found how to write it for one field but what if I have many? Looking for some simple solution when they click on submit button and if some required  fields are not filled it will show message which fields are not filled (or even message “fill up required fields” is enough) and it will prevent them from closing the form until everything is filled.

26 replies

null
    • Fred
    • 1 mth ago
    • Reported - view

    You don't say if the users are filling out a dashboard/page or creating a record directly in the table.

    I'm going to assume that you are using a dashboard since you always want to limit direct user interaction with your data.

    You can put the following code in a button:

    let t := this;
    let xlf := urlDecode("%0A");
    let nameCheck := if Name = null then 1 else 0 end;
    let scoreCheck := if Score = null then 1 else 0 end;
    let rankCheck := if Rank = null then 1 else 0 end;
    let fieldCheck := [nameCheck, scoreCheck, rankCheck];
    if sum(fieldCheck) = 0 then
        let newRec := (create TableA);
        newRec.(
            'Name of Cars' := t.Name;
            Score := t.Score;
            Rank := t.Rank
        );
        alert("New Record Added")
    else
        alert("Please fill in the following fields:" +
        if item(fieldCheck, 0) = 1 then
            xlf + "Name of Car"
        end +
        " " +
        if item(fieldCheck, 1) = 1 then
            xlf + "Score"
        end +
        "" +
        if item(fieldCheck, 2) = 1 then
            xlf + "Rank"
        end +
        "
    
        ")
    end

    Line 1: takes the current record and puts it in a variable "t".

    Line 2: creates a variable that stores a carriage return

    Lines 3 - 5: shows how we check three fields for a null value. We check to see if the field is empty and if it is then we assign a value of 1 or 0 if it is full. You will need to create a line for each of the field you want to be required.

    Line 6: creates an array of the "-check" variables above and stores it in a variable.

    Lines 7 - 31: is the heart of the code. Since we have an array of numbers we can do some fancy stuff with it. Line 7 starts us off checking to sum of the array in Line 6 and if it is equal to 0 (meaning all the fields have data in them) then we can create a new record in the appropriate table (change the table name to match your situation. We even pop up an alert to tell the user a new record got created.

    Line 15 starts the part of the code that jumps when if the sum of the array is not equal to 0. Here we create an alert that will list all of the fields that are empty. The important thing to learn here is the escape characters:

     "+ +"

    Why are they needed? Well an alert() command normally just takes whatever you type in between double quotes and displays it. Well we need to "escape" out of the quotes and tell Ninox to run some code then return to the display something else.

    So we start our alert() with:

    alert("Please fill in the following fields:")

    now we have to escape out to run some code. So it will look like:

    alert("Please fill in the following fields:"+ +" ")

    Notice I put both opening "+ and ending  +" in so I always know that I closed things properly and just have to make sure I put the code in between. The first field looks like this:

    alert("Please fill in the following fields:" +
        if item(fieldCheck, 0) = 1 then
            xlf + "Name of Car"
        end +
        "
    
        ")

    This formatting is done by Ninox so I've kept it. We will now check the array we made above to see which fields are empty and need to be reported to the user. We will use the item() command. The first property in the parentheses is the array you are checking. The second property is the instance you want to pull. Like all other programming language the first instance is 0 and goes up from there.

    Line 2: we get the first instance of the array with the item() command and check to see if it is equal to 1 (meaning it is empty) and if it is then we print the variable that stores the carriage return and the name of the field.

    Now how do we add another field? Take a look:

    alert("Please fill in the following fields:" +
        if item(fieldCheck, 0) = 1 then
            xlf + "Name of Car"
        end +
        " " +
        if item(fieldCheck, 1) = 1 then
            xlf + "Score"
        end +
        "" +
        if item(fieldCheck, 2) = 1 then
            xlf + "Rank"
        end +
        "
    
        ")

    You want to make sure you don't put a carriage return after the double quote on lines 5 and 9. Otherwise you will have too many in the alert. So you can just copy a section then paste it and then change the number in the item() command to the next one and then change the text to match.

    I've attached a DB. Open the Dashboard then click on the Field Check tab and you can see it in action.

    • Michal_Bor
    • 1 mth ago
    • Reported - view

    Hi Fred,

    Thank you for your response!

    There is a problem, it kind of creates two records when I click on the button. Please see the picture, in one record it has selected the Shop and in second it does not, both those records were made when clicked on the button.

    did I adjust the script correctly?:

    let t := this;
    let xlf := urlDecode("%0A");
    let dateCheck := if DATE = null then 1 else 0 end;
    let weekCheck := if WEEK = null then 1 else 0 end;
    let turnoverCheck := if TURNOVER = null then 1 else 0 end;
    let fieldCheck := [dateCheck, weekCheck, turnoverCheck];
    if sum(fieldCheck) = 0 then
        let newRec := (create 'DAILY SALES DAPP');
        newRec.(
            DATE := t.DATE;
            WEEK := t.WEEK;
            TURNOVER := t.TURNOVER
        );
        alert("New Record Added")
    else
        alert("Please fill in the following fields:" +
        if item(fieldCheck, 0) = 1 then
            xlf + "DATE"
        end +
        " " +
        if item(fieldCheck, 1) = 1 then
            xlf + "WEEK"
        end +
        "" +
        if item(fieldCheck, 2) = 1 then
            xlf + "TURNOVER"
        end +
        "
    
        ")
    end
    

    also is it possible to remove cross option to close the form

    • Fred
    • 1 mth ago
    • Reported - view
     said:
    There is a problem, it kind of creates two records when I click on the button. Please see the picture, in one record it has selected the Shop and in second it does not, both those records were made when clicked on the button.

    There is nothing in the code that tells Ninox to create two records. Can you post a sample DB, with dummy data?

     said:
    also is it possible to remove cross option to close the form

    If you remove the close button how would close the record and return to the Create Reports form? I'm guessing you clicked on a record from the View element in Create Reports, so Ninox opens a new subwindow so you can see the record you clicked on. But Ninox needs to allow you to return to the original table, thus the close button.

      • Michal_Bor
      • 1 mth ago
      • Reported - view

       

      Hi,

      please see attached database, there should be two records (one is made by me and second was created after submitting via button) the second record have filled only fields that are in the script.

      • Fred
      • 1 mth ago
      • Reported - view

       You just need to expand the list of fields that you copy, Shop being one of them.

    • Michal_Bor
    • 1 mth ago
    • Reported - view

    Hi Fred,

    I don't understand what you mean "to expand the list of fields that you copy, Shop being one of them." do you mean i have to first add all the required fields in the formula? And then it should work?

      • Fred
      • 1 mth ago
      • Reported - view

      You want the field SHOP to be copied. That is just one of the required fields that the picture shows as required. So if you want to expand the code to include SHOP it would look something like:

      let t := this;
      let xlf := urlDecode("%0A");
      let dateCheck := if DATE = null then 1 else 0 end;
      let weekCheck := if WEEK = null then 1 else 0 end;
      let turnoverCheck := if TURNOVER = null then 1 else 0 end;
      let shopCheck := if SHOP = null then 1 else 0 end;
      let fieldCheck := [dateCheck, weekCheck, turnoverCheck, shopCheck];
      if sum(fieldCheck) = 0 then
          let newRec := (create 'DAILY SALES DAPP');
          newRec.(
              DATE := t.DATE;
              WEEK := t.WEEK;
              TURNOVER := t.TURNOVER
              SHOP := t.SHOP
          );
          alert("New Record Added")
      else
          alert("Please fill in the following fields:" +
          if item(fieldCheck, 0) = 1 then
              xlf + "DATE"
          end +
          " " +
          if item(fieldCheck, 1) = 1 then
              xlf + "WEEK"
          end +
          "" +
          if item(fieldCheck, 2) = 1 then
              xlf + "TURNOVER"
          end +
          "" +
          if item(fieldCheck, 3) = 1 then
              xlf + "SHOP"
          end +
          "
          ")
      end
      

      When you add more fields then you would continue to add

      1) the appropriate new variable in the check section and to the fieldCheck variable

      2) the appropriate field names in the newRec section

      3) the new section to the else part

      • spinner_7580
      • 1 mth ago
      • Reported - view

        It sounds like this DB is run as a web app.  If so, isn't it true that the alert function in the script won't display to the web user.

      • Fred
      • 1 mth ago
      • Reported - view

      That is a good thought, but he did put it in a button.

       

       said:
      it kind of creates two records when I click on the button
    • Michal_Bor
    • 1 mth ago
    • Reported - view

    Hi,

    i understand how to add all the fields in the formula. But I do not want our shop managers go into each table with records. So I have created separate view where they select between three different records Daily sales report, Hanging Production report, Pricing production report. Under each they will find button create report and it opens the entry form. When I click on create report it automatically creates empty record and when i start to fill up data it all goes into that record so until this point everything is ok. But at the end of the entry form is button to "submit record" (i need this as We have problems with managers forgetting some fields to fill up and makes me crazy when I need to evaluate statistics so I need them to be forced to fill up everything) so when they click on that submit button it creates one more record with the same data.

    Anyway I think I found the issue, now I have removed from script the part that creates the record so it only pops out the message, and it does not create two records.

    What makes me still worry, they will find reasons why not to fill it up all fields despite they get message from button and use the cross to close it. This is why I asked if it is possible to remove the cross and if it is possible to close the entry form when clicking on submit button when everything is filled up?

      • Fred
      • 1 mth ago
      • Reported - view

       I am sorry to have misunderstood the issue. 

      One way to take complete control of the data entry process is to recreate the all necessary fields in your dashboard. Have the submit button in the dashboard and now users can not leave any field empty that you don’t want unless they don’t want to submit a record.

      Now you don’t need to worry about the “close” window button. In addition users never interact with your raw data directly, which is always a scary thing. :)

      It may seem like a lot of duplicate effort, but it will make sure your data is clean.

      You can breakup the data entry into required fields and non required fields. Required fields show up first and a user can click on a button that will show non-required fields. It can end up being quicker for users.

    • Michal_Bor
    • 1 mth ago
    • Reported - view

     I believe i did not describe it properly, as I am very new to this. But it still will help as for now  they at least press the button and see what is missing. 

    So just to make sure I understand correctly, in the dashboard I will create new fields with same names as are in the table for Daily sales (where are kept all data) and in the submit button to have script that enters data from dashboard fields to Daily sales under condition required fields must be filled in?

    All fields will be required 🙂

    Do you know if there is created topic where I could see how the script goes for this solution? Or what to exactly ask if I post topic for this issue? I am trying to look for something to this issue but cannot find anything.

    How would i connect field  "Turnover" in dashboard to field "TURNOVER" in table Daily sales by clicking on button submit? Just give me a kick start... 

      • Fred
      • 1 mth ago
      • Reported - view

      The script would be very similar to the Submit button you already have. Looking it over you can just copy the script over and just change the names to match the field names in dashboard (you probably won't call the DATE field DATE as it might have to be specific to this table, so it might be called dailyReportDate).

    • Michal_Bor
    • 1 mth ago
    • Reported - view

     Thanks it works! 

    I have still one more question. Everything is filled up, click on button and data is uploaded to correct table. Is it possible so the fields in dashboard get empty so new record can be made?

      • Fred
      • 1 mth ago
      • Reported - view

      at the end of the script you have to put

      newfield1 := null (for text, number fields, choice field)

      referencefield1 := 0

      dynamicchoicefield1 := 0

    • Michal_Bor
    • 1 mth ago
    • Reported - view

    it shows for the newfield1 "end expected

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 mth ago
      • Reported - view

       

      newfield1 := null ;

    • Michal_Bor
    • 1 mth ago
    • Reported - view
    let t := this;
    let xlf := urlDecode("%0A");
    let dateCheck := if Date = null then 1 else 0 end;
    let shopCheck := if SHOPS = null then 1 else 0 end;
    let weekCheck := if WEEK = null then 1 else 0 end;
    let turnoverCheck := if TURNOVER = null then 1 else 0 end;
    let fieldCheck := [dateCheck, shopCheck, weekCheck, turnoverCheck];
    if sum(fieldCheck) = 0 then
        let newRec := (create 'DAILY SALES DAPP');
        newRec.(
            DATE := t.Date;
            SHOP := t.SHOPS;
            WEEK := t.WEEK;
            TURNOVER := t.TURNOVER
        );
        alert("New Record Added")
    else
        alert("Please fill in the following fields:" +
        if item(fieldCheck, 0) = 1 then
            xlf + "DATE"
        end +
        " " +
        if item(fieldCheck, 1) = 1 then
            xlf + "SHOP"
        end +
        " " +
        if item(fieldCheck, 2) = 1 then
            xlf + "WEEK"
        end +
        "" +
        if item(fieldCheck, 3) = 1 then
            xlf + "TURNOVER"
        end +
        "
    
        ")
    end
    newField := null;
    
    referencefield1 := 0
    
    dynamicchoicefield1 := 0
    

    still doesn't work, maybe i dont place it correctly?

      • Rafael Sanchis
      • Rafael_Sanchis
      • 1 mth ago
      • Reported - view

       

      DATE := null;

      WEEK := null;

      TURNOVER := null;

      For each field 

    • Michal_Bor
    • 1 mth ago
    • Reported - view

      still doesn't work

    • Michal_Bor
    • 1 mth ago
    • Reported - view

    I have managed to create button for clearing the fields and works. See the script, any chance this could be somehow put into script for button to submit record?

    let check := dialog("Attention", "This will clear all fields", ["CLOSE", "DELETE"]);
    if check = "DELETE" then
        Date := null;
        SHOPS := 0;
        WEEK := null;
        TURNOVER := null
    end
    
    • Michal_Bor
    • 1 mth ago
    • Reported - view

      For some reason it displays only first four fields, if the rest of fields is not filled in it will submit the report anyway. Is there something written wrong in the script?

     

    let t := this;
    let xlf := urlDecode("%0A");
    let dateCheck := if Date = null then 1 else 0 end;
    let shopCheck := if SHOPS = null then 1 else 0 end;
    let weekCheck := if WEEK = null then 1 else 0 end;
    let turnoverCheck := if TURNOVER = null then 1 else 0 end;
    let targetCheck := if TARGET1 = null then 1 else 0 end;
    let itemsputinCheck := if 'ITEMS PUT IN' = null then 1 else 0 end;
    let donationsCheck := if DONATIONS = null then 1 else 0 end;
    let otherCheck := if OTHER = null then 1 else 0 end;
    let itemssoldCheck := if 'ITEMS SOLD' = null then 1 else 0 end;
    let itemsoutCheck := if 'ITEMS OUT' = null then 1 else 0 end;
    let ebayoutCheck := if 'EBAY OUT' = null then 1 else 0 end;
    let othershopCheck := if 'OTHER SHOP' = null then 1 else 0 end;
    let rejectedkgCheck := if 'REJECTED KG' = null then 1 else 0 end;
    let customersCheck := if CUSTOMERS = null then 1 else 0 end;
    let peopleinCheck := if 'PEOPLE IN' = null then 1 else 0 end;
    let onepoundsoldpcsCheck := if '£1 SOLD PCS' = null then 1 else 0 end;
    let onepoundsoldpoundCheck := if '£1 SOLD £' = null then 1 else 0 end;
    let twopoundsoldpcsCheck := if '£2 SOLD PCS' = null then 1 else 0 end;
    let twopoundsoldpoundCheck := if '£2 SOLD £' = null then 1 else 0 end;
    let threepoundsoldpcsCheck := if '£3 SOLD PCS' = null then 1 else 0 end;
    let threepoundsoldpoundCheck := if '£3 SOLD £' = null then 1 else 0 end;
    let bagssoldpcsCheck := if 'BAGS SOLD PIECES' = null then 1 else 0 end;
    let bagssoldpoundCheck := if 'BAGS SOLD £' = null then 1 else 0 end;
    let workinghoursCheck := if 'WORKING HOURS' = null then 1 else 0 end;
    let productionhoursCheck := if 'PRODUCTION HOURS' = null then 1 else 0 end;
    let productionkghangedCheck := if 'PRODUCTION KG HANGED' = null then 1 else 0 end;
    let productionitemshangedCheck := if 'PRODUCTION ITEMS HANGED' = null then 1 else 0 end;
    let cashCheck := if CASH = null then 1 else 0 end;
    let cardCheck := if CARD = null then 1 else 0 end;
    let fieldCheck := [dateCheck, shopCheck, weekCheck, turnoverCheck, targetCheck, itemsputinCheck, donationsCheck, otherCheck, itemssoldCheck, itemsoutCheck, ebayoutCheck, othershopCheck, rejectedkgCheck, customersCheck, peopleinCheck, onepoundsoldpcsCheck, onepoundsoldpoundCheck, twopoundsoldpcsCheck, twopoundsoldpoundCheck, threepoundsoldpcsCheck, threepoundsoldpoundCheck, bagssoldpcsCheck, bagssoldpoundCheck, workinghoursCheck, productionhoursCheck, productionkghangedCheck, productionitemshangedCheck, cashCheck, cardCheck];
    let fieldCheck := [dateCheck, shopCheck, weekCheck, turnoverCheck];
    if sum(fieldCheck) = 0 then
        let newRec := (create 'DAILY SALES DAPP');
        newRec.(
            DATE := t.Date;
            SHOP := t.SHOPS;
            WEEK := t.WEEK;
            TURNOVER := t.TURNOVER;
            TARGET := t.TARGET1;
            'ITEMS PUT IN' := t.'ITEMS PUT IN';
            DONATIONS := t.DONATIONS;
            OTHER := t.OTHER;
            'ITEMS SOLD' := t.'ITEMS SOLD';
            'ITEMS OUT' := t.'ITEMS OUT';
            'EBAY OUT' := t.'EBAY OUT';
            'OTHER SHOP' := t.'OTHER SHOP';
            'REJECTED KG' := t.'REJECTED KG';
            CUSTOMERS := t.CUSTOMERS;
            'PEOPLE IN' := t.'PEOPLE IN';
            '£1 SOLD PCS' := t.'£1 SOLD PCS';
            '£1 SOLD £' := t.'£1 SOLD £';
            '£2 SOLD PCS' := t.'£2 SOLD PCS';
            '£2 SOLD £' := t.'£2 SOLD £';
            '£3 SOLD PCS' := t.'£3 SOLD PCS';
            '£3 SOLD £' := t.'£3 SOLD £';
            'BAGS SOLD PIECES' := t.'BAGS SOLD PIECES';
            'BAGS SOLD £' := t.'BAGS SOLD £';
            'WORKING HOURS' := t.'WORKING HOURS';
            'PRODUCTION HOURS' := t.'PRODUCTION HOURS';
            'PRODUCTION KG HANGED' := t.'PRODUCTION KG HANGED';
            'PRODUCTION ITEMS HANGED' := t.'PRODUCTION ITEMS HANGED';
            CASH := t.CASH;
            CARD := t.CARD
        );
        alert("New Record Added")
    else
        alert("Please fill in the following fields:" +
        if item(fieldCheck, 0) = 1 then
            xlf + "DATE"
        end +
        " " +
        if item(fieldCheck, 1) = 1 then
            xlf + "SHOP"
        end +
        " " +
        if item(fieldCheck, 2) = 1 then
            xlf + "WEEK"
        end +
        " " +
        if item(fieldCheck, 3) = 1 then
            xlf + "TURNOVER"
        end +
        " " +
        if item(fieldCheck, 4) = 1 then
            xlf + "TARGET1"
        end +
        " " +
        if item(fieldCheck, 5) = 1 then
            xlf + "ITEMS PUT IN"
        end +
        " " +
        if item(fieldCheck, 6) = 1 then
            xlf + "DONATIONS"
        end +
        " " +
        if item(fieldCheck, 7) = 1 then
            xlf + "OTHER"
        end +
        " " +
        if item(fieldCheck, 8) = 1 then
            xlf + "ITEMS SOLD"
        end +
        " " +
        if item(fieldCheck, 9) = 1 then
            xlf + "ITEMS OUT"
        end +
        " " +
        if item(fieldCheck, 10) = 1 then
            xlf + "EBAY OUT"
        end +
        " " +
        if item(fieldCheck, 11) = 1 then
            xlf + "OTHER SHOP"
        end +
        " " +
        if item(fieldCheck, 12) = 1 then
            xlf + "REJECTED KG"
        end +
        " " +
        if item(fieldCheck, 13) = 1 then
            xlf + "CUSTOMERS"
        end +
        " " +
        if item(fieldCheck, 14) = 1 then
            xlf + "PEOPLE IN"
        end +
        " " +
        if item(fieldCheck, 15) = 1 then
            xlf + "£1 SOLD PCS"
        end +
        " " +
        if item(fieldCheck, 16) = 1 then
            xlf + "£1 SOLD £"
        end +
        " " +
        if item(fieldCheck, 17) = 1 then
            xlf + "£2 SOLD PCS"
        end +
        " " +
        if item(fieldCheck, 18) = 1 then
            xlf + "£2 SOLD £"
        end +
        " " +
        if item(fieldCheck, 19) = 1 then
            xlf + "£3 SOLD PCS"
        end +
        " " +
        if item(fieldCheck, 20) = 1 then
            xlf + "£3 SOLD £"
        end +
        " " +
        if item(fieldCheck, 21) = 1 then
            xlf + "BAGS SOLD PIECES"
        end +
        " " +
        if item(fieldCheck, 22) = 1 then
            xlf + "BAGS SOLD £"
        end +
        " " +
        if item(fieldCheck, 23) = 1 then
            xlf + "WORKING HOURS"
        end +
        " " +
        if item(fieldCheck, 24) = 1 then
            xlf + "PRODUCTION HOURS"
        end +
        " " +
        if item(fieldCheck, 25) = 1 then
            xlf + "PRODUCTION KG HANGED"
        end +
        " " +
        if item(fieldCheck, 26) = 1 then
            xlf + "PRODUCTION ITEMS HANGED"
        end +
        " " +
        if item(fieldCheck, 27) = 1 then
            xlf + "CASH"
        end +
        " " +
        if item(fieldCheck, 28) = 1 then
            xlf + "CARD"
        end +
        "
    
        ")
    end
    
      • Fred
      • 1 mth ago
      • Reported - view

      take a look at lines 32 and 33. what is happening there? what line can be removed?

      • Fred
      • 1 mth ago
      • Reported - view

      remember to mark the post answered if you are satisfied.

    • Michal_Bor
    • 1 mth ago
    • Reported - view

     i have made one more button for another report, but has the same problem as with button for DAILY SALES, when i add at then the part to delete information from field, line 127 it shows problem. Any chance you could look please what I am doing wrong? I have used null or 0 according what you wrote before.

    let t := this;
    let xlf := urlDecode("%0A");
    let dateCheck := if Date = null then 1 else 0 end;
    let productsCheck := if PRODUCT = null then 1 else 0 end;
    let shopsCheck := if SHOP = null then 1 else 0 end;
    let employeesCheck := if NAME = null then 1 else 0 end;
    let preparedwhereCheck := if PREPARED = null then 1 else 0 end;
    let startCheck := if START = null then 1 else 0 end;
    let endCheck := if END = null then 1 else 0 end;
    let breakstartCheck := if 'BREAK START' = null then 1 else 0 end;
    let breakendCheck := if 'BREAK END' = null then 1 else 0 end;
    let break2startCheck := if 'BREAK 2 START' = null then
            1
        else
            0
        end;
    let break2endCheck := if 'BREAK 2 END' = null then 1 else 0 end;
    let break3startCheck := if 'BREAK 3 START' = null then
            1
        else
            0
        end;
    let break3endCheck := if 'BREAK 3 END' = null then 1 else 0 end;
    let kgpreparedCheck := if 'KG PREPARED' = null then 1 else 0 end;
    let itemspreparedCheck := if 'ITEMS PREPARED' = null then
            1
        else
            0
        end;
    let itemsrejectedCheck := if 'ITEMS REJECTED' = null then
            1
        else
            0
        end;
    let fieldCheck := [dateCheck, productsCheck, shopsCheck, employeesCheck, preparedwhereCheck, startCheck, endCheck, breakstartCheck, breakendCheck, break2startCheck, break2endCheck, break3startCheck, break3endCheck, kgpreparedCheck, itemspreparedCheck, itemsrejectedCheck];
    if sum(fieldCheck) = 0 then
        let newRec := (create 'HANGING PRODUCTION');
        newRec.(
            DATE := t.Date;
            PRODUCT := t.PRODUCT;
            SHOP := t.SHOP;
            NAME := t.NAME;
            'PREPARED WHERE' := t.PREPARED;
            START := t.START;
            END := t.END;
            'BREAK START' := t.'BREAK START';
            'BREAK END' := t.'BREAK END';
            'BREAK 2 START' := t.'BREAK 2 START';
            'BREAK 2 END' := t.'BREAK 2 END';
            'BREAK 3 START' := t.'BREAK 3 START';
            'BREAK 3 END' := t.'BREAK 3 END';
            'KG PREPARED' := t.'KG PREPARED';
            'ITEMS PREPARED' := t.'ITEMS PREPARED';
            'ITEMS REJECTED' := t.'ITEMS REJECTED'
        );
        alert("New Record Added")
    else
        alert("Please fill in the following fields:" +
        if item(fieldCheck, 0) = 1 then
            xlf + "DATE"
        end +
        " " +
        if item(fieldCheck, 1) = 1 then
            xlf + "PRODUCTS"
        end +
        " " +
        if item(fieldCheck, 2) = 1 then
            xlf + "SHOPS"
        end +
        "" +
        if item(fieldCheck, 3) = 1 then
            xlf + "NAME"
        end +
        "" +
        if item(fieldCheck, 4) = 1 then
            xlf + "PREPARED"
        end +
        "" +
        if item(fieldCheck, 5) = 1 then
            xlf + "START"
        end +
        "" +
        if item(fieldCheck, 6) = 1 then
            xlf + "END"
        end +
        "" +
        if item(fieldCheck, 7) = 1 then
            xlf + "BREAK START"
        end +
        "" +
        if item(fieldCheck, 8) = 1 then
            xlf + "BREAK END"
        end +
        "" +
        if item(fieldCheck, 9) = 1 then
            xlf + "BREAK 2 START"
        end +
        "" +
        if item(fieldCheck, 10) = 1 then
            xlf + "BREAK 2 END"
        end +
        "" +
        if item(fieldCheck, 11) = 1 then
            xlf + "BREAK 3 START"
        end +
        "" +
        if item(fieldCheck, 12) = 1 then
            xlf + "BREAK 3 END"
        end +
        "" +
        if item(fieldCheck, 13) = 1 then
            xlf + "KG PREPARED"
        end +
        "" +
        if item(fieldCheck, 14) = 1 then
            xlf + "ITEMS PREPARED"
        end +
        "" +
        if item(fieldCheck, 15) = 1 then
            xlf + "ITEMS REJECTED"
        end +
        "
    
        ")
    end
    
        Date := null;
        PRODUCT := 0;
        SHOP := 0;
        NAME := 0;
        PREPARED := null;
        START := null;
        END := null;
        'BREAK START' := null;
        'BREAK END' := null;
        'BREAK 2 START' := null;
        'BREAK 2 END' := null;
        'BREAK 3 START' := null;
        'BREAK 3 END' := null;
        'KG PREPARED' := null;
        'ITEMS PREPARED' := null;
        'ITEMS REJECTED' := null;
    
    end
    

Content aside

  • 1 mth agoLast active
  • 26Replies
  • 167Views
  • 4 Following