problems with portals and popups

  • Follow


Hi have a portal in my invoices database that lists all outstanding
invoices, which are kind of like line items.  Each invoice belongs to a
parent Services database.  Everything is working fine: when you click
on a certain button in the portal, a popup window appears telling you
the detail of that service.  It's the kind of popup that freezes the
window and takes away the status bar.  When you click Done on the
popup, the window disappears and you are back to where you started.
Works great, until I discovered a bug...

The first command in the script is a related record command (isn't it
stupid that if you put ANYTHING in front of it, the related record
command will not work?  anyway...)

The problem I'm having is that if someone accidentally deletes the
parent service record, there is no related record to go to, and it
continutes on with the script and FREEZES and takes the status bar away
from the main window, not the popup.

I wanted to write a script indicating that if there's an error, to halt
the script so it doesn't continue, but then I realized that no error
has occurred.  Is there any way to avoid this problem?

Thanks

David Averbach
FileMaker Developer 8
Mac OS 10.4.6

0
Reply averbach (17) 6/14/2006 4:02:32 AM

David,

Can you elaborate a little on this?

- I haven't noticed any trouble with "go to related record" in scripts when 
it is not the first line. Have I just been lucky, or do you have an example?

- How does someone delete a record between clicking the button on a portal 
in that record and seeing your popup window?

- Are you sure no error is returned by Get(LastError) in this situation? At 
the very least should you be able to check get(WindowName) to only hide the 
status area on the appropriate window.


"davey" <averbach@mac.com> wrote in message 
news:1150257752.216014.45520@p79g2000cwp.googlegroups.com...
> Hi have a portal in my invoices database that lists all outstanding
> invoices, which are kind of like line items.  Each invoice belongs to a
> parent Services database.  Everything is working fine: when you click
> on a certain button in the portal, a popup window appears telling you
> the detail of that service.  It's the kind of popup that freezes the
> window and takes away the status bar.  When you click Done on the
> popup, the window disappears and you are back to where you started.
> Works great, until I discovered a bug...
>
> The first command in the script is a related record command (isn't it
> stupid that if you put ANYTHING in front of it, the related record
> command will not work?  anyway...)
>
> The problem I'm having is that if someone accidentally deletes the
> parent service record, there is no related record to go to, and it
> continutes on with the script and FREEZES and takes the status bar away
> from the main window, not the popup.
>
> I wanted to write a script indicating that if there's an error, to halt
> the script so it doesn't continue, but then I realized that no error
> has occurred.  Is there any way to avoid this problem?
>
> Thanks
>
> David Averbach
> FileMaker Developer 8
> Mac OS 10.4.6
> 


0
Reply wjm (450) 6/14/2006 6:28:57 AM


The problem is IF someone deletes a related service record and then
later tries to go to it by clicking on the button in the portal row of
the portal that lists all invoice records, there is no related to
record to go to (because it is deleted).  It appears not to return an
error.  Then, it continues with the script.  The hide status area
script command does not have a check box that allows you to specify the
window, and specifying a window that never popped up doesn't work.

Also, maybe I'm wrong about the first line thing.  But, for example,
you can't do a setfield command before the related record command. (But
that's another topic).



Bill Marriott wrote:
> David,
>
> Can you elaborate a little on this?
>
> - I haven't noticed any trouble with "go to related record" in scripts when
> it is not the first line. Have I just been lucky, or do you have an example?
>
> - How does someone delete a record between clicking the button on a portal
> in that record and seeing your popup window?
>
> - Are you sure no error is returned by Get(LastError) in this situation? At
> the very least should you be able to check get(WindowName) to only hide the
> status area on the appropriate window.
>
>
> "davey" <averbach@mac.com> wrote in message
> news:1150257752.216014.45520@p79g2000cwp.googlegroups.com...
> > Hi have a portal in my invoices database that lists all outstanding
> > invoices, which are kind of like line items.  Each invoice belongs to a
> > parent Services database.  Everything is working fine: when you click
> > on a certain button in the portal, a popup window appears telling you
> > the detail of that service.  It's the kind of popup that freezes the
> > window and takes away the status bar.  When you click Done on the
> > popup, the window disappears and you are back to where you started.
> > Works great, until I discovered a bug...
> >
> > The first command in the script is a related record command (isn't it
> > stupid that if you put ANYTHING in front of it, the related record
> > command will not work?  anyway...)
> >
> > The problem I'm having is that if someone accidentally deletes the
> > parent service record, there is no related record to go to, and it
> > continutes on with the script and FREEZES and takes the status bar away
> > from the main window, not the popup.
> >
> > I wanted to write a script indicating that if there's an error, to halt
> > the script so it doesn't continue, but then I realized that no error
> > has occurred.  Is there any way to avoid this problem?
> >
> > Thanks
> >
> > David Averbach
> > FileMaker Developer 8
> > Mac OS 10.4.6
> >

0
Reply averbach (17) 6/14/2006 9:17:07 AM

David,

1) I guess I don't understand the relationship between the layout someone is 
on, invoice records, and service records in your solution. Nevertheless, you 
could have a script like this:

If Count(ServiceTable::ID) > 0
  Go to Related Record [...]
End If

Provided there isn't actually some bug that prevents GTRR from working when 
it's not the first line in a script ;)

2) For hiding the status area, you use a similar structure:

If Get(WindowName) = "My Intended Window"
  Hide Status Area
End If

This only hides the status area if the correct window is active.

3) In the Set Field situation, you probably need to Commit Record before you 
jump somewhere else, especially if the GTRR is based on the field you've 
just set.


"davey" <averbach@mac.com> wrote in message 
news:1150276627.801929.191480@h76g2000cwa.googlegroups.com...
> The problem is IF someone deletes a related service record and then
> later tries to go to it by clicking on the button in the portal row of
> the portal that lists all invoice records, there is no related to
> record to go to (because it is deleted).  It appears not to return an
> error.  Then, it continues with the script.  The hide status area
> script command does not have a check box that allows you to specify the
> window, and specifying a window that never popped up doesn't work.
>
> Also, maybe I'm wrong about the first line thing.  But, for example,
> you can't do a setfield command before the related record command. (But
> that's another topic).
>
>
>
> Bill Marriott wrote:
>> David,
>>
>> Can you elaborate a little on this?
>>
>> - I haven't noticed any trouble with "go to related record" in scripts 
>> when
>> it is not the first line. Have I just been lucky, or do you have an 
>> example?
>>
>> - How does someone delete a record between clicking the button on a 
>> portal
>> in that record and seeing your popup window?
>>
>> - Are you sure no error is returned by Get(LastError) in this situation? 
>> At
>> the very least should you be able to check get(WindowName) to only hide 
>> the
>> status area on the appropriate window.
>>
>>
>> "davey" <averbach@mac.com> wrote in message
>> news:1150257752.216014.45520@p79g2000cwp.googlegroups.com...
>> > Hi have a portal in my invoices database that lists all outstanding
>> > invoices, which are kind of like line items.  Each invoice belongs to a
>> > parent Services database.  Everything is working fine: when you click
>> > on a certain button in the portal, a popup window appears telling you
>> > the detail of that service.  It's the kind of popup that freezes the
>> > window and takes away the status bar.  When you click Done on the
>> > popup, the window disappears and you are back to where you started.
>> > Works great, until I discovered a bug...
>> >
>> > The first command in the script is a related record command (isn't it
>> > stupid that if you put ANYTHING in front of it, the related record
>> > command will not work?  anyway...)
>> >
>> > The problem I'm having is that if someone accidentally deletes the
>> > parent service record, there is no related record to go to, and it
>> > continutes on with the script and FREEZES and takes the status bar away
>> > from the main window, not the popup.
>> >
>> > I wanted to write a script indicating that if there's an error, to halt
>> > the script so it doesn't continue, but then I realized that no error
>> > has occurred.  Is there any way to avoid this problem?
>> >
>> > Thanks
>> >
>> > David Averbach
>> > FileMaker Developer 8
>> > Mac OS 10.4.6
>> >
> 


0
Reply wjm (450) 6/14/2006 10:02:47 AM

You can have other commands before the GTRR script step BUT if any of
these commands exit the record then FileMaker doesn't know what portal
record you clicked the button in and therefore won't bring you to the
correct record.  To get around this problem you could set a variable to
the portal number as the first step in the script, then do what ever
other actions you need to do, tell the script to return to a field in
the portal and then to go to portal number based on the value in the
variable.

As of FM7 you can't simply GTRR and expect a found count of 0 if there
aren't any related records, a real pain in the ass but that's life.
Instead you must first test if there are related records eg.
If( not IsValid(RelatedTableOccurrence::SomeIDField))
   exit script
end if

It sounds like you're GTRR through the displayed Invoice record
directly to the Service table record.  If that's the case then your if
valid record exists test needs to test for a Service record, not an
Invoice record.

0
Reply ad (117) 6/14/2006 9:42:46 PM

4 Replies
42 Views

(page loaded in 0.073 seconds)

Similiar Articles:







7/17/2012 11:58:06 AM


Reply: