5 Replies Latest reply on Jul 19, 2010 10:36 AM by philmodjunk

    Possible to change properties of Object using a Script

    BodiceaOverall

      Title

      Possible to change properties of Object using a Script

      Post

      Hello

      I would like to change, say the data->behaviour->field entry of a particular field in my script.  Any suggestions? 

       

      Example.JPG

        • 1. Re: Possible to change properties of Object using a Script
          LaRetta_1

          Please provide more information.  Can you give an example?  Also, it would help to know the FM version you are using.

          • 2. Re: Possible to change properties of Object using a Script
            BodiceaOverall

            FileMaker Pro v11.2

            Scenario - Layout displays a 'calendar' which will give the user an idea of what time slots are available and which ones are not.  For safety reasons I don't want to have these records editable (is that a word??), but it may be that at this point they want to book a time slot and to do this they need to edit the record. 

            It would have been nice to double-click the timeslot for that day and then open up a new layout where they could add all the details required for that particular timeslot.  However, there is no option I can see to set a script to trigger on double-click....and also cannot seem to retrieve the values of the selected record as I expect this is down to the fact that it cannot really be 'selected' as it is closed for editing. 

            Anyway, I am using GTRR to do this currently, but I have to leave the records open for editing so that GTRR works.  So can I write something in the script that says....set field to edit from not edit (only one field is visible for the record on the layout), which if you were doing it manually would involve checking/unchecking the <field entry> property in the Inspector.

            It would be useful to know how to do this generally as I am used to manipulating the properties of an object in other database solutions. 

            It is not really workable to do all this in the same layout due to the fact that the 'calendar' week view takes up most of the screen!  Also it would mean having to add additional fields from the record to the layout and I haven't enough 'real estate' to do this.

            I will try and get a screen shot in on my original post.

             

            • 3. Re: Possible to change properties of Object using a Script
              philmodjunk

              In your screen shot, I see either a: 1) table view, 2) list view, or 3) Nonscrolling portal...

              In all of these, each row is a separate record and that's key to the following suggestion:

              You can't change layout properties of objects like you can in some other systems, but you can define a field as as a button. When the user clicks the button, they make that row the current record and your script can use new window to open a small floating window that displays the current record's fields in a different layout where editing is permitted. You can also just switch the user to that other "edit" layout if your don't want to pop up a separate window.

              • 4. Re: Possible to change properties of Object using a Script
                BodiceaOverall

                Thanks Phil, this is very useful as I am sure I can use it generically.  What would I do without you guys!

                • 5. Re: Possible to change properties of Object using a Script
                  philmodjunk

                  If you are interested, the Known Bugs List database that you can download from: http://www.4shared.com/file/fzZsnqE-/FMP_Bugsv4.html

                  Uses a very similar technique to control editing of the version history. Feel free to look over its script for additional details on using a floating window for data entry.