4 Replies Latest reply on Feb 22, 2014 11:51 AM by mark_b

    Reformating fields from script

    sgbotsford

      I'm working on an inventory application for use with an iPad. Trying to do everything with popups. I know that I have mislabeled inventory. When certain types of corrections are made, I want to highlight other fields that should be checked. That highlight is then removed by touching the item twice, once to open up the popup box, once to close it.

       

      Groveling through the script wizard, I've not found a way to set background color or border width, from within the script.

       

      Another post has made references to functions that are not in the script wizard. I'm guessing that I need to access some form of script editor, and also a reference for fm funtions.

       

      Eventually I also want to disable going to the next record until all highlighted boxes have been cleared.

       

      Is this possible?

       

      Is this a good way to go about getting better data entry?

        • 1. Re: Reformating fields from script
          sgbotsford

          More looking:  Found the function reference, but there was little joy there.  While in principle I can change the font, it doesn't appear possible to change the fill or the border.

           

          There may be possibilities with the Conditional Formatting.

           

          Suppose the script on field A on first select stores it's value to a variable.  Then on release compares the current value to the value before.  If they are changed, and flag_B is set.

           

           

           

          Now the conditional formatting for Field B is set to formula and has something like

          Get ( Flag_B) >0

           

          Is this a workable method?

           

          When is conditional formatting evaluated?  Would this field change at the appropriate time?  (When Field A was changed)

          • 2. Re: Reformating fields from script
            Stephen Huston

            You could avoid any script for this by using condition formats to decide how the field should display if it fails to meet the criteria of a calculation. Conditional formatting will simply do it and then clear the "warning" feature when the contents meet the calculated criteria.

             

            You can also use the new Hide by Calculation functionality in 13 to display a wanring over the field until the correct field criteria are met, at which point it quits appearing on the layout.

            • 3. Re: Reformating fields from script
              sgbotsford

              Hmm.  Ok, the comparison of the before and after state of the first field

              can be the calculation.  But then how is the calculation cleared?  No,

              better to set a flag, and having the close list clear the flag.  It may

              mean that there is a one line script attached to the close list.

               

              (The example I gave was a simplified one.  A record is about 15 fields.

              Changing any field may require changes of several of the fields following.)

               

              The inventory program replaces a pencil and paper system with one on an

              iPad.  In outline it works like this:

               

               

              Each record has the species (abbreviated by a code), a location, a lower

              height and upper height that span 80% of the specimens, an optional average

              caliper, the size and type of growing container, how many there are, an

              estimate of the percent salable, and the last date the record was modified.

               

              So if the species code is wrong, then, everything has to be checked.

              Changing the lower height means the upper height should be checked.

               

               

               

              Respectfully,

               

              Sherwood of Sherwood's Forests

               

              Sherwood Botsford

              Sherwood's Forests --  http://Sherwoods-Forests.com

              780-848-2548

              50042 Range Rd 31

              Warburg, Alberta T0C 2T0

              • 4. Re: Reformating fields from script
                mark_b

                I had a situation where multiple values had to be correct before the record was validated.  What I did was to set up a calculated field that was a huge case statement that went through all the possible "screw-ups" that could happen.  When the value of the calculated field was 0, then all was fine.  The use of conditional formatting would be used to flag the "bad" field.  When someone changes a value in one field, you could also have an "OnObjectModify" script trigger on that field that would set a global field to non-zero.  That global field could be one of the cases in the other calculated field to set it to be non-zero.  That in turn would be monitored by the other conditional fields changing their background to another color - thus notifying the user to check it's value.  When all had been checked the nasty case calculation would go to zero and all would be fine.   I hope I made some sense and didn't ramble too much.  But by the use of calculated fields, conditional formatting and script triggers, you should be able to get the result you are looking for.

                Cheers, Mark

                 

                p.s., You could also use a calculated ToolTip (based on the result of the nasty case calculation) to let the user know what needs to be done.