3 Replies Latest reply on Mar 19, 2013 7:18 AM by philmodjunk

    If field contains, then this

    LysMaruszewski

      Title

      If field contains, then this

      Post

           Hi -

           I have a field that that is alpha numeric - it contains something that looks like "J0010". What I'm trying to do is this:

           If (OrderField) contains "J", then Go To Field (OrderField) Insert Text [Select; "I"]

           I don't care about the numbers, just the letter.

           Any help is GREATLY appreciated! Thanks!

        • 1. Re: If field contains, then this
          philmodjunk

               There are a variety of ways to use the value in field 1 to determine what text appears in field 2 that do not require a script:

               If ( Left ( Field1 = "J" ; "I" ; self )

               Could be used as an auto-enter calculation for field 2.

               You could also set up a related table of records and set up field 2 with a looked up value field option to copy a letter into field 2.

               And if field 2 does not need to be editable you can make it a calculation field with:

               If ( Left ( Field1 = "J" ; "I" )

               Ps. and when you use a script to put data into a field, Set Field is a better option than Insert Text in almost all cases.

          • 2. Re: If field contains, then this
            LysMaruszewski

                 I don't think I did a very good job of explaining myself. If field 1 has a value of J0069 or J0076 or J0100 I want to replace the contents of field one with the letter I. So field 1 would go from J0069 (or whatever) to I. Is this possible?

                  

                 THANKS!

            • 3. Re: If field contains, then this
              philmodjunk

                   Set up an auto-enter calculation on Field 1.

                   If ( Left ( self ; 1 ) = "J" ; "I" ; self )

                   Clear the do not replace existing value check box.