3 Replies Latest reply on Jan 4, 2017 6:47 AM by mikebeargie

    How can my user edit value lists "from field"?

    embeco

      I have a large amount of drop-downs in my application and I need to utilize value lists from a table so they won't get wiped out when I update the program. It works fine but what scripting is needed to allow my user to update these values from the field utilizing them. "Allow editing of value list" is greyed out.

        • 1. Re: How can my user edit value lists "from field"?
          mikebeargie

          If the value lists are based on tables, your scripting should be adding/deleting/modifying the records and values in those tables the lists are based off of. Say I had a table of countries, and a value list based on Countries::CountryName. I can't edit static values for the list, I need to actually add or change a record in the Countries table itself to have the change show in the value list.

           

          "Allow editing of values" is an option only for static value lists, that are typed out in the first screen of the value list dialog. If you are using a static value list, and it is still greyed out, chances are the privilege set used for that account does not have the "edit value lists" permission granted properly. Under File > Manage > Security > Privilege Sets, you can double click on a set to edit the settings, value lists is on the left side of the dialog in the middle.

          • 2. Re: How can my user edit value lists "from field"?
            embeco

            Thanks, Mike. I keep hoping that there is a better way than writing 1107

            scripts.

             

             

             

            Steve

            • 3. Re: How can my user edit value lists "from field"?
              mikebeargie

              You can do it all with one script and a few global fields if you want. Just use script parameters to determine the table, value and action.

               

              EG:

              Set Variable [ $layout ; Get(LayoutNumber) ]

              Set Variable [ $table ; GetValue( Get(ScriptParameter) ; 1 ) ]

              Set Variable [ $value ; GetValue( Get(ScriptParameter) ; 2 ) ]

              Set Variable [ $action ; GetValue( Get(ScriptParameter) ; 3 ) ]

               

              If [ $table = “states” ]

                 Go To Layout [ “states” ]

                 If [ $action = “add” ]

                    New Record / Request / Page

                    Set Field [ states::name ; $value ]

                 Else If [ $action = “delete” ]

                    Perform Find [ states::name = $value ]

                    Delete Record

                 End If

               

              Else If [ $table = “countries” ]

                 Go To Layout [ “countries” ]

                 If [ $action = “add” ]

                    New Record / Request / Page

                    Set Field [ countries::name ; $value ]

                 Else If [ $action = “delete” ]

                    Perform Find [ countries::name = $value ]

                    Delete Record

                 End If

               

              Etc..

               

              End If

               

              Go To Layout [ Number by Calc ; $layout ]

              There are plenty of more ways to compact this and make it more dynamic to handle all sorts of actions and

               

              In the above, when you call the script, you just need to specify the parameters and have it do the work for you. A simple calc works:

              List ( "states" ; "OH" ; "delete" )

               

              Or just forego scripting completely, and setup a folder of table or list view layouts with the ability to edit the table data and have your users go there to make changes. No scripting required except for maybe some simple navigation.

              1 of 1 people found this helpful