1 2 Previous Next 23 Replies Latest reply on Feb 17, 2011 1:37 PM by Sorbsbuster

    Global Field Inaccessible in IWP

    Sorbsbuster

      Title

      Global Field Inaccessible in IWP

      Post

      I have a script that cycles through various searches and counts and builds up the results into a final summary report, displayed in a global gReportResult field, where the user can browse it, or click a 'Copy' button on the screen to allow them to paste it and edit the results, say.

      It works perfectly for all clients in an FM multi-user environment. However when it is accessed through IWP my 'Copy' button (a simple one-line script that is 'Copy, Field, Select All)')doesn't work. I have checked that the 'Copy' script step is IWP-compatible, and in the text of the FM manual it explicitly says it is, with no restrictions or caveats.

      If I manually highlight the contents of the field (in the web browser) and copy them, I can paste them successfully. If I try to emulate that and change the script to be: - Go to field - Select All - Copy ... it fails If I change the script step to set the gReportResult field to be: Set Field = gReportResult = "I have changed this ---" & gReportResult ...field then it does that edit perfectly.

      After much changing and testing I realised that if I change the field that is to be copied to be a non-global field everything works correctly. It is as if the web-client does not recognise the contents of the global field - yet it *does* if I manually select the contents and copy them, and it *does* if I use their contents in a SELF-referencing calculation. (As part of my experiments to find a work-around, I temporarily set a non-global field to store the data of the global gReportResult field and treid to copy it from there - but it wouldn't set the 'normal' field in the first place.

      So: it wouldn't use the contents of the global field to set another field, but would use them to re-set itself?) I know that global fields behave differently for clients versus hosts, single-user versus shared, etc, but I had not realised that global fields can appear to be 'invisible' to the 'Copy' script step.

      In summary: - Access a file remotely using IWP, use the 'Copy' script step to copy the contents of a field to the clipboard. - Works perfectly if the field is a normal field - Fails completely if the field is a global field Question: am I missing something simple, or is there a work-around?

      Thanks in advance,

      Alan

        • 1. Re: Global Field Inaccessible in IWP
          Sorbsbuster
          Sorry for the poor display of the question - in the original Posting dialogue it was well-presented with returns and spaces (honest), but it posted up like a stream-of-consciousness.  I tried to 'Edit post' but it presented it back to me in the original dialogue box... perfectly presented.
          • 2. Re: Global Field Inaccessible in IWP
            philmodjunk

            In what part of the layout is the global field? (header, body, footer...)

            Is the global field defined in the same table referred to by your layout or a different table?

            • 3. Re: Global Field Inaccessible in IWP
              Sorbsbuster

              Thanks for the quick response, Phil.

              - The field is in the Body.

              - Same table.  (And I have tried explicitly driving the script to the correct table, correct field, etc, and it doesn't make any difference.)

              Principle: Do various 'Finds' in a table and count the results each time.  Build up a $Variable as each result is returned, and set the final data into a gReportResult field.  As I say, it works perfectly for each FM client.  It is just in IWP that it 'blanks' the field contents.

              Is there any other test you think I should try, to determine where the problem lies?  It really is a simple as using the script step 'Copy' [etc], which works perfectly with each client, and perfectly if the field to be copied is not a global.

              • 4. Re: Global Field Inaccessible in IWP
                philmodjunk

                I really don't know--especially as it works for FM Clients over the network. That rules out a lot of possible issues here.

                Copy does require that the field being copied be physically present on the layout in order for it to copy the data. Paste and Insert script steps have the same limitation. I'm was speculating that the fact that the user is using a web browser somehow trips over this same limitation. However, that does explain why a local file works where the global does not and why you can't use set Field to copy the contents of the global field to a local field.

                Just to check all possible issues, can you confirm that the global field is of type text?

                You might also try creating a very simple test file with minimal fields from scratch, then publish and test it to make sure it's not some undiscovered issue with the original file...

                Ultimately, you may want to post this to Report an Issue and see what TSGal and company have to say. (She's running behind, so don't expect an immediate answer.)

                • 5. Re: Global Field Inaccessible in IWP
                  Sorbsbuster

                  Thanks, Phil,  I will now try the stripped-down test file as you suggest.

                  - The global field is type 'text'.

                  - I had tried creating another ('normal') text field to 'Set Field', and I made sure it was on the layout.  No difference

                  Will post back after the simplified file test.

                  Thanks again.

                  • 6. Re: Global Field Inaccessible in IWP
                    Sorbsbuster
                    - I am accessing the file through localhost (though I first found the problem accessing the file remotely) I created a simple 1-table file with 2 fields, FieldIndexed and FieldGlobal, both of type text. I created 4 scripts - Copy the indexed field - Copy the global field - Set the indexed field to have the data of the global field - Set the global field to have the data of itself & "---" & itself All scripts work perfectly in Filemaker Client (version 11) When run via IWP - The first two ('Copy') scripts do *not* work - the second two ('Set Field') scripts work perfectly. I am using WinXP, and Firefox, BTW.
                    • 7. Re: Global Field Inaccessible in IWP
                      Sorbsbuster
                      Back to poor formatting.  Sorry for the irritation.
                      • 8. Re: Global Field Inaccessible in IWP
                        philmodjunk

                        Can you test it with Internet Explorer? (maybe it's a browser specific issue.)

                        This sounds like something to report in Report an Issue. If you do, please copy and paste the link to this thread so that TSGal or other interested parties can easily get to this thread to see what investigation has already been carried out.

                        (If you paste a link into the forum and then press the return key with the cursor immediately to the right of the link text, the forum software will convert the link text into a live, clickable link.)

                        • 9. Re: Global Field Inaccessible in IWP
                          philmodjunk

                          I tried to 'Edit post' but...

                          As Community Leader, I can edit other folk's posts. I wanted to see if your text contained any hidden HTML tags--an issue I've already reported, but none showed when I used the HTML link to open your original post.

                          Since I had it open anyway, I went ahead and edited your original post. It took the returns for me, don't know why it didn't for you...

                          • 10. Re: Global Field Inaccessible in IWP
                            Sorbsbuster

                            The formatting thing is strange, as I've posted exactly the same way as an original post, and as replies, on two different computers both running XP, and even this (second) one has posted in two different ways from the same source - 'Post an answer'.  Thanks for the editing.

                            (There is something else strange - I can never get the 'Copy' of a global field to work, but *sometimes* the normal field will.  My last summary of slightly-more-formal testing said that copying neither field type worked, but I was encouraged originally in my testing when I could change layout (in the script), copy another (normal) field, and successfully return the contents to the clipboard.  In the simple file I could get neither to work - but I will do some more testing now in case I was simply befuddled between the IWP screen and its similarlity to the FM Client screen.)

                            • 11. Re: Global Field Inaccessible in IWP
                              Sorbsbuster

                              Clarification of original post:

                              I confirm that in the simple file I can get the 'Copy' script to work on *neither* field.  In a way I'm glad, as it seems such a fundamental problem that I believe I am doing something wrong.

                              • 12. Re: Global Field Inaccessible in IWP
                                philmodjunk

                                More likely, it's an undocumented limitation of Copy and Paste.

                                • 13. Re: Global Field Inaccessible in IWP
                                  TSGal

                                  Sorbsbuster:

                                  Thank you for your post.

                                  I am unable to replicate the problem.  This is what I have done.

                                  1. I created a table with three fields:

                                  Name (Text)
                                  Extra (Text)
                                  Global (Text - Global storage)

                                  2. I entered one record with Name = "TSGal"

                                  3. I created a script as follows:

                                  Copy [ Select ; Name ]
                                  Paste [ Extra ]
                                  Commit Records/Requests [ No dialog ]

                                  4. I place a button on the Layout that executes this script.  It works correctly.  I blanked out the field "Extra".

                                  5. I turned on Instant Web Publishing and made it accessible to all users.

                                  6. On another machine, I launched a Browser and opened the hosted file via Instant Web Publishing.

                                  7. I clicked the button, and "TSGal" now appears in Extra.

                                  8. Back on the host machine, I created another script as follows:

                                  Set Field [ Global ; "sorbsbuster" ]
                                  Commit Records/Requests [ No dialog ]
                                  Copy [ Select ; Global ]
                                  Paste [ Select ; Extra ]
                                  Commit Records/Requests [ No dialog ]

                                  9. I added another button to the layout to perform the script.

                                  10. In instant Web Publishing, I clicked the second button, and "sorbsbuster" appears in Extra.

                                  Since variables were introduced, I have never needed to use Copy and paste, but it still appears to work.

                                  Please let me know what I'm doing differently than you.

                                  TSGal
                                  FileMaker, Inc.

                                  • 14. Re: Global Field Inaccessible in IWP
                                    philmodjunk

                                    Even before variables, I didn't use copy, paste except for certain rare specialty uses, I'd use set field with a global field instead. Wink

                                    1 2 Previous Next