12 Replies Latest reply on Jun 12, 2015 7:04 AM by philmodjunk

    Pop-up questions

    tays01s

      Title

      Pop-up questions

      Post

      I have a pop-up, showing within each row of a portal:

      1. It's linked using an ESQL calc to another field of a related table. The calc works fine, but until you choose a value from the pop-up returns a '?'. The latter might confuse a new user; can I force the first pop-up value to be chosen until the user overrides? [Keep in mind that the pop-up value list can change, so it won't be the same value every time].

      2. Is it possible to dynamically have say 3 favourite values at the top of the pop-up list..........but that these are based on usage and, pushing my luck here, both favourites and std items are sorted alphabetically?

        • 1. Re: Pop-up questions
          philmodjunk

          An auto-enter calculation can enter the first member of a value list:

          GetValue ( ValueListItems ( Get ( FileName ) ; "ValueListNameHere" ) ; 1 )

          • 2. Re: Pop-up questions
            tays01s

            I've done the auto-enter calc including choosing context of the evaluation as the TO2 that the portal in which it sits is based on. However, it fails to show any name in the pop-up immediately on producing a new portal row.

            • 3. Re: Pop-up questions
              philmodjunk

              If you click a blank area of the layout, does the default value then appear?

              Does your file name include an additional period besides the one in ".FMP12"?

              • 4. Re: Pop-up questions
                tays01s

                1. No reaction when clicking on blank layout.

                2. Filename did have another '.' but the auto-enter calc still fails after re-naming/ re-launching the file.

                Would it make any difference that the portal, containing the pop-up, is filtered?

                • 5. Re: Pop-up questions
                  philmodjunk

                  You need to first determine if ValueListItems is returning data. There is a known bug when using get(Filename) as a parameter to certain design functions such as ValueListItems if your file name has an added period such as:

                  databse.v1.fmp12.

                  Try setting up an unstored calculation field with just the ValueListItems function or test it in the data viewer as a watch expression if you are using advanced.

                  I suspect though that it's an update/timing issue. If you can get ValueListItems to return the list of values, can you create the record first, commit records by clicking a blank area of the layout (or by changing layouts) and then see if a default value appears in the field? (You can use a script to create the record or you can enter data in a different field of the portal first.)

                  • 6. Re: Pop-up questions
                    tays01s

                    The ValueListItems etc calcs appear to work in Data Viewer, but a new portal row results in no update, even when refreshed. I've added a 'commit record' immediately after 'new record' within the script.

                    Almost certainly unrelated, but this portal is perculiar because it fails to sort alphabetically, even though it's twin portal, using a different valuelist does so perfectly. However, both have the problem of not committing the first value in their valuelist.

                    • 7. Re: Pop-up questions
                      tays01s

                      The ValueListItems etc calcs appear to work in Data Viewer, but a new portal row results in no update, even when refreshed. I've added a 'commit record' immediately after 'new record' within the script.

                      Almost certainly unrelated, but this portal is perculiar because it fails to sort alphabetically, even though it's twin portal, using a different valuelist does so perfectly. However, both have the problem of not committing the first value in their valuelist.

                      • 8. Re: Pop-up questions
                        philmodjunk

                        When I test this in a test file, it works for me. But I can't use selecting from the value list as the action that creates the portal record. I have to create the record first, commit records and then the first value of the value list appears in the field. I put two fields in the portal row of the test file. Field 1 was an edit box and field 2 was a drop down list and auto-entered the first value. When I entered data into field 1 and clicked a blank area of the layout to commit the record, the initial value list item appeared in field 2.

                        • 9. Re: Pop-up questions
                          tays01s

                          Apologies for not replying sooner. Yes, I'd already tried that, ie, create new portal row, tab to portal edit field, clicking inside or outside the portal. Nothing causes the "GetValue ( ValueListItems ( Get ( FileName ); "Drugs_displayed" ) ; 1 )"

                          to get the first value into the pop-up.

                          • 10. Re: Pop-up questions
                            philmodjunk

                            All I can say is that it worked for me just as I described. Had I needed this in one my solutions, I would have used a button for adding the new related record and then the new record would appear in the layout with the correct initial value as determined by the current values in the value list.

                            • 11. Re: Pop-up questions
                              tays01s

                              Could the problem be that I have 2 portals using the same field for the pop-up but with different ValueLists? ie. the Autoenter can't grab the first value for both because they would conflict.

                              • 12. Re: Pop-up questions
                                philmodjunk

                                Don't see how that would keep it from entering a value. The auto-enter would enter the first value of whichever of the two value lists you choose to specify in the auto-enter calculation.