attach script to field?

  • Follow


Is it possible to attach a script to a field, so that always when the
content is changed, the script runs? I'd like to run a script on a
global field, that will take the entered value and use it as a basis for
creating several records in related databases. 

Is there an (non applescript) event model in Filemaker, that I can be
(made) more aware of? Or is it all hidden? I'd like to stay in more
control over what happens on my layouts.
0
Reply michaellastname (33) 9/12/2003 10:52:31 AM

You can use the events plugin from Waves in Motion to trigger a script
when a field is modified.  However, I believe this works by placing an
external function inside the field validation calculation.  Obviously,
there is no field validation for globals.



However, there is an old undocumented trick that allows you to add
validation to globals.  If you take a regular field (text, number, date,
time, etc) and set a validation for it, then change the field to a
global, the validation will still be applied when editing the global
field.  I'm not sure if an external functional would still be triggered
though, but I imagine it would.



You can check out the events plug-in at:

http://www.wmotion.com/events.html



(btw, there are several other similar plug-ins on the market; check
filemaker's web site for a fairly comprehensive listing of plug-ins:
http://www.filemaker.com/plugins -- look on the right side, there is a
list of plug-in categories with more plug-ins.)


--
Mariano Peterson


Posted via http://dbforums.com
0
Reply marianopeterson 9/12/2003 9:19:15 PM


Hi Michael

Not currently (we all live in hope...).

There is a work around but it really only works with fields that are
formatted as pop-up lists since the entire entry has to be made in the space
of a single loop. 

Take the field out of the tab order and make it a button attached to a
script:

Set Field [ FieldName, "" ]
Go to Field [ FieldName ] [ Select/perform ]
Loop
Pause/Resume Script [ �0:00:01� ]
Exit Loop If [ not IsEmpty(FieldName) ]
End Loop

.... followed by whatever you want to happen after the field is entered or
edited.

On Windows, I believe you can set the pause to nothing and that it performs
better.  ("Its just a bug", she consoles herself...)

Bridget Eley

in article 1g15gpl.1lif00f127asfyN%michaellastname@mac.com, Michael Bystroem
at michaellastname@mac.com wrote on 12/9/03 8:52 PM:

> Is it possible to attach a script to a field, so that always when the
> content is changed, the script runs? I'd like to run a script on a
> global field, that will take the entered value and use it as a basis for
> creating several records in related databases.
> 
> Is there an (non applescript) event model in Filemaker, that I can be
> (made) more aware of? Or is it all hidden? I'd like to stay in more
> control over what happens on my layouts.

0
Reply Bridget 9/12/2003 10:14:45 PM

Bridget Eley <bridgeteley@ihug.com.au> wrote:

> There is a work around but it really only works with fields that are
> formatted as pop-up lists since the entire entry has to be made in the space
> of a single loop. 

Thanks Bridget. At least one of my problems will be solved by this. Very
nice. 
0
Reply michaellastname 9/13/2003 11:30:24 PM

marianopeterson <member38786@dbforums.com> wrote:

> However, there is an old undocumented trick that allows you to add
> validation to globals.  If you take a regular field (text, number, date,
> time, etc) and set a validation for it, then change the field to a
> global, the validation will still be applied when editing the global
> field.  I'm not sure if an external functional would still be triggered
> though, but I imagine it would.

I'll check it out. Thanks for the tip.

> http://www.filemaker.com/plugins 
Cool. I'll have a look.
0
Reply michaellastname 9/13/2003 11:30:25 PM

Bridget Eley <bridgeteley@ihug.com.au> wrote:

> There is a work around but it really only works with fields that are
> formatted as pop-up lists since the entire entry has to be made in the space
> of a single loop. 
> 
> Take the field out of the tab order and make it a button attached to a
> script:
> 
> Set Field [ FieldName, "" ]
> Go to Field [ FieldName ] [ Select/perform ]
> Loop
> Pause/Resume Script [ "0:00:01" ]
> Exit Loop If [ not IsEmpty(FieldName) ]
> End Loop
> 
> ... followed by whatever you want to happen after the field is entered or
> edited.

Bridget, when I tried this now I realized this nice solution would be
close to perfect if you could post a mouse click to bring up the popup.
Is there any way in Filemaker to post a mouseclick?

As it is know the user have to click twice to bring up the list.
0
Reply michaellastname 9/24/2003 12:05:46 PM

in article 1g1rqxt.1hix8bb1yc6zziN%michaellastname@mac.com, Michael Bystroem
at michaellastname@mac.com wrote on 24/9/03 10:05 PM:

> Bridget, when I tried this now I realized this nice solution would be
> close to perfect if you could post a mouse click to bring up the popup.
> Is there any way in Filemaker to post a mouseclick?

Only in our dreams...

> As it is know the user have to click twice to bring up the list.

The popup should appear on the first click.



-- 

Bridget Eley

(to email direct, replace "DOT" with "." and remove ".invalid")

0
Reply Bridget 9/24/2003 8:41:20 PM

Michael Bystroem <michaellastname@mac.com> wrote:

> Bridget Eley <bridgeteley@ihug.com.au> wrote:
> 
> > There is a work around but it really only works with fields that are
> > formatted as pop-up lists since the entire entry has to be made in the space
> > of a single loop. 
> > 
> > Take the field out of the tab order and make it a button attached to a
> > script:
> > 
> > Set Field [ FieldName, "" ]
> > Go to Field [ FieldName ] [ Select/perform ]
> > Loop
> > Pause/Resume Script [ "0:00:01" ]
> > Exit Loop If [ not IsEmpty(FieldName) ]
> > End Loop
> > 
> > ... followed by whatever you want to happen after the field is entered or
> > edited.
> 
> Bridget, when I tried this now I realized this nice solution would be
> close to perfect if you could post a mouse click to bring up the popup.
> Is there any way in Filemaker to post a mouseclick?
> 
> As it is know the user have to click twice to bring up the list.

Actually, it worked very nice as Bridget described, if you followed it
closely. Very nice solution indeed.
0
Reply michaellastname 11/1/2003 9:16:19 PM

7 Replies
318 Views

(page loaded in 0.118 seconds)

Similiar Articles:













7/15/2012 3:01:12 AM


Reply: