
Go to a spesific row in a portal
The step "Go to Portal Row" accepts various parameters ("Select First",
"Select Last", etc.) that tell it what portal row to go to. It sounds as
though you have selected "Select, By Field Value" and then chosen the
Customer ID as the field to use (is the Customer ID of the current record
101?).
In any event, you really want to pass the value of the field in that portal
row, and use it (the value) as a search criterion. While FMP will perform a
search in a related file (i.e., a portal), it is faster to perform that
search locally, in the other file, and then come back when the search is
completed.
In the Customer file, create a script that performs the search, using a
global text field ("gSearch") as the find criterion. You will pass the value
to this global. In Customer, the script might run (if the search is for the
Customer Name):
Set Error Capture[On]
Enter Find Mode[]
Set Field["Customer Name", "gSearch"]
Perform Find[]
...Do stuff if records are found
...Do stuff if no records are found (Status(CurrentError)=401)
Create, in each file, a calculation field ("Constant"), returning a number,
and defined as 1 (the number one). In the Order file, create a 'generic' or
'constant' realationship to Customer, using Constant as the match field on
both sides. The idea is that all records in each file will be related to all
records in the other file. Then, create a script (in Order):
Set Field["Constant::gSearch", "Customer::Customer Name"]
Perform Script[Sub-script, External: "Customer.fp5"]
Do Something Local (like Exit Record/Request, or Go to Field)
The Set Field step passes the value of the Customer Name in the selected
portal row (the cursor must be in the portal row) to gSearch, which then
passes it again in the local Find script in Customer. "Do Something
Local..." means call any local script step, even if it doesn't really do
something, to return focus to the current file (Order).
--
John Weinshel
Datagrace
Associate Member, Filemaker Solutions Alliance
Vashon Island, WA
(206) 463-1634
Quote:
> Im new to portals and have some problems understanding this in FM 5.0.
> My cumstomer database (CD) is displayed in a portal in the order
> database (OD). I want to perform a find request on customer name in OD,
> and Im using a script that ends with <Go to Portal Row(CustomerID)> in
> the OD.
> The problem is that Im always ending up with the same selected row; row
> #101 from the CD.
> Ive been throught the online documentation, the latest posting here and
> some FM websites, but I would be pleased to get some help from you.
> Regards
> --
> ......_/_/_/_/_/_/_/..... Web: http://www.macx.no/
> ...._/...._/...._/....... Phone: +47 55924915 - Cell: 97548190
> .._/...._/...._/......... Address: Fjellbirkeland - 5224 NESTTUN