4 Replies Latest reply on Aug 27, 2011 9:05 AM by TomB_1

    Show message when a field entry matches an entry in a value list

    TomB_1

      Title

      Show message when a field entry matches an entry in a value list

      Post

      Hi all

      What I am trying to do is simply show a message when a value entered into a field in a portal matches a value from a list of values entered into a value list.

      I have an invoicing system and when a user enters a certain part number in a portal if that part number matches a part number from a list of part numbers in a value list it will show a message. I will use a script trigger on the part number field to run the script. I could hard code the part numbers but then when a part is changed or added then I would have to modify the script. Not efficient.

      Thanks all.

       

      Tom

        • 1. Re: Show message when a field entry matches an entry in a value list
          Abhaya

          Hi

          I think you want to check a entered value in alist of values and fire error message.

          So pls go through this

          set a variable that holds the entered value and match it with the list of values.

          e.g pater count(list values,variable)

          if the variable value exist in the list it returns its occurance.

          depending upon its value you may show your message.

          And all the script step must attached with the on exit trigger .

           

           

          Thanks

          • 2. Re: Show message when a field entry matches an entry in a value list
            TomB_1

            Hi Atauf

            My problem is I use the same functions over and over. I have never used PatternCount. Because I am just a casual user I forget over time and also don't make the time to try out the various functions etc. 

            Having used this simple function with the ValuelistItems funtion and a variable this script was so simple its embarrasing for me that I had to ask how to do this. But it worked like a hotdamn! Does just what I want.

            Once again the great people of this forum have saved my bacon!

            Many thanks to you Atauf

             

            Tom

            • 3. Re: Show message when a field entry matches an entry in a value list
              philmodjunk

              If you put your list of part numbers into a "warning" table. You can do this without scripting by setting up a relationship to this table. To change the part numbers that trigger this warning message, you can change the records in this table. With two tables, one for the message and one to list the parts that trigger it, you can even display multiple warning messages and both the parts listed and the messages become data any authorized user can update them.

              • 4. Re: Show message when a field entry matches an entry in a value list
                TomB_1

                Thanks for tip  PMJ

                My needs here are quite simple. Users have no need to either modify or add a new message. It is a simple "Notice" what you are doing message. The script was very simple and took a couple minutes to write and is activated by a script trigger. But your tip will be stuffed in my toolbelt as I can see other uses for it. Appreciate it!!

                 

                Tom