Announcement

Collapse
No announcement yet.

can't display title on first load with select field

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • can't display title on first load with select field

    I am trying to display title with my form select field, but I keep getting first value of my sql select statement. I already tried to use Initial Value, but this does not work. I can set {field} = 'title OnLoad, but this code will be performed each time form is reloaded.

    I am using this SQL:

    SELECT DISTINCT Site
    FROM data
    WHERE id_active = 1
    ORDER BY Site ASC

    WHEN I use this I get title displayed on first load, but Site is not selected distinct:

    SELECT DISTINCT id, Site
    FROM data
    WHERE id_active = 1
    ORDER BY Site ASC
    Last edited by poltergeist; 11-26-2012, 11:51 PM.

  • #2
    ok...found a solution in forum:

    OnApplicationIni:
    sc_apl_conf("MyApp.php","start","new");

    Thought I could handle this without searching such a solution...

    Comment


    • #3
      well, can't use this because my Slave Grid won't load based on the global variables that I've applied with Master Form

      Comment


      • #4
        nobody? As I said, I can't display title on first load...form is always doing the select and throws in first hit instead of title!

        Comment


        • #5
          Hi!

          You can go to the select field and in the "Lookup settings" you can select yes to the "Use title" option. Hope this is what you are looking for.
          Regards,

          Ishwor

          Comment


          • #6
            Thank you...I am using Scriptcase for 2 years approx and Using Title is checked...but thanx anyhow

            Comment


            • #7
              Hello,

              I have just reported this topic to our bugs team.

              Have you tried SELECT DISTINCT site, id?

              regards,
              Bernhard Bernsmann

              Comment


              • #8
                Right now I am using this SQL query...i opened a ticket...

                SELECT DISTINCT t1.SiteCode,
                CASE
                WHEN t2.SiteCode IS NULL
                THEN t1.SiteCode
                ELSE t2.Site
                END
                AS 'Site'
                FROM xxx t1
                LEFT JOIN
                yyy t2 ON t2.SiteCode=t1.SiteCode
                ORDER BY SiteCode ASC

                Upon first app call i get database value selected to start with, instead of title...title is active and displayed in select field as well
                Last edited by poltergeist; 12-11-2012, 08:24 PM.

                Comment


                • #9
                  Hello,

                  Could you send me an image of your configurations on SC and another of the application running?

                  regards,
                  Bernhard Bernsmann

                  Comment


                  • #10
                    Hello,

                    I send the application to support...

                    Comment


                    • #11
                      well, support can't solve this...this is a really strange behaviour of title. Normal behaviour would be to show title to start with, but I can't make it work. I tried an control application, but here I can't link grid in IFrame.

                      Comment


                      • #12
                        Hello Forum,

                        since support does not consider my issue a bug and I can't find a solution, I would like to ask for help.

                        As reported: I have a Form with 3 Fields of type SELECT. Field 1 is getting data from database with a select statement, Field 2+3 are manual select fields. My Form has a linked grid in IFrame below, showing a grid. My problem is, when I first load Form with linked Grid, My first select field shows the first hit with pulled data from database instead showing the title to start with (Title would be something like: "Make a Selection"). Support told me to use a Control Application, but I can't link grid in IFrame then.

                        Why is this a problem?

                        Because Form already made a selection, but grid does not yet have all values from my Form select fields (they are not present as variables yet). So I need to make a another selection in order to reload the page, then my grid does get the needed values to display correct selection of data in grid.

                        Any help appreciated!

                        Comment


                        • #13
                          Hi poltergeist,
                          when you base a FORM on a table, you get either the first record that matches your criteria or the first record of the table. That's the nature of things.
                          Anyway, the idea of a Control App. isn't probably that bad.
                          You could run the Control that looks like your form without the grid at first call, gather all the information you need and then redirect to your form/grid application with all the values as parameters. This would ensure that you start with a valid dataset.

                          Hope this helps.

                          jsb

                          Comment


                          • #14
                            Hi there,

                            I need the control above my grid (no redirect). The only working solution would be to have a blank dataset row with my called table where I can apply a title. But I would like to keep my tables clean. Anyhow: strange behaviour of title. Title should always be called first upon first load!

                            Comment


                            • #15
                              The only way to use a title with SELECT field is adding an extra blank database entry with ID 0 and exclude this with any updates I run with database.

                              Comment

                              Working...
                              X