Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 7991 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have a relation between two files for example:

Realation:Cust2order = Customers --> Orders (CustId <-> Orders::CustId)

I want from the customers file to go to a related record in orders file, but

a customer have more than one orders. How can I use in the Cust2order relation field key definition and the Orders file match key (OrderId) together with

(CustId)so the script command "Go to related record" to have a succesful execution?

Posted

If you have a portal and you place a button in the portal line that uses the Go To Related Record [your relationship for the portal]

It will go to the correct order, even if the customer has more than one order. Now, if you want to limit the orders to just those for THAT customer, add the option Show Only Related when you select the Go To Related Records option.

Now, this isn't allowing you to select any specific layout in your related orders file. For that you will have to script the button.

First write the script in your orders file for the correct layout (and anything else you want to do in that file).

Then, come back to your customer file and write your script

Go To Related Record [your relationship for the portal]

Perform Script [external, orders.fp5 "Your script here"]

HTH

Posted

If I understand, you want to go to a specific Customer Order from the Customer file. As you said, this customer could have 10 customer orders related.

You then need to show a list of Customer Orders related to that customer in order to choose the specific one and script a Go to Related Record.

There are therefore 2 solutions :

1.Use a portal with your relationship and set a script inside the portal with a GTRR.

2.Use a value list.

This last method would need :

- global field (call it g_filterCustOrder) with same format as your Customer Order# field,

- Relationship [color:"red"]filterCustOrders --> Customer:g_filterCustOrder::Customer Order : CustomerOrder#

Then, go in Format menu for g_filterCustOrder (or in the Define Value List Menu), create a [color:"red"] "filtered customer orders" value-list choosing Values from Field using the Customer Order file. Select "Related Only" in the Specify fields from Value List dialog box and select the relationship CustOrdertoCustomer=CustomerOrder:Cust_ID::Customer:Cust_ID (just create it if doesn't already exist).

Then you will be able to choose your Customer Order # with a pop-up menu using the global field. Place a button next to this field with a GTRR script set using [color:"red"]filterCustOrders

The first method would be used if you need to clearly identify the Customer Order you need to jump into (the portal would display a set of fields with date/status...). The second would allow to keep "spaces" in your layout.

Note that you can sort your value list (setting the sort in the relationship CustOrdertoCustomer ) and that you can add an identificant to lead to this formated value-list :

CustOrder0004 03/02/24

CustOrder0005 03/01/20

CustOrder0006 03/01/10

While in the Specify fields from Value List dialog box, check "Select also Values from" for this last feature.

Posted

If a customer have 2 orders with the Show Only Related

choice I shall go to the first relation record of 2 because

it understand the relation between CustomerId's and not

OrderId's. The problem is that I must go to the right order

of the customer and for the moment with my previous described relations it doesn't know the right Order Id

to go. I' not using a portal only a button.

Posted

If you wants to see first order, sort your relationship with Ascending Customer Order date. For last by Descending Customer Order dates.

A single button with GTRR (with go to layout step) will be sufficient then.

Posted

Ok Ugo I will remind you my problem in the portals

forum to give you another paradigm for what I need:

"My problem is that I have a file with name "Room Reservations" and another file

with name "Plan of rooms" with a related portal from a third file with name "tempfile". I use the temp file to hold all the reservations for a room using "RoomId" match field so the portal in the "Plan of rooms" can appear all

the reservations for each room. The real problem is that because I have a relation between "Plan of rooms" and "Temp" files I can not use the portal fields.If I click them to go to a related record in the "Room Reservations" file. How can I make the portal to be related with both files?"

So after the solution who Ugo gives me I can go from the

portal line to correct Room. But imagine that in my portal

plan a specific room have two reservations in the same line

one at 3/2/03 and one at 3/4/03. When I click in the same

portal line the field of 3/2/03 it is go to the correct record in the Reservation file but if I click in the same

portal line the field of 3/4/03 it is go again to the first record in the Reservation file who can find, for

this example the reservation of 3/2/03 and not 3/4/04.

Because the relationship of the portal it is builded in

the RoomId basis and not in the ReserveId basis.

I need both...

A liitle example shape of the plan:

........3/2/03..3/4/03..3/5/03

Room1....Cust1...........Cust2

Room2....Cust3...Cust3...Cust3

Room3............Cust4...Cust4

Posted

I think I understand. I've got some bad and good news for you.

The bad news is that the table proposed here nannot be realised in FM (at least without some developments, may be plug-ins).

The good one is that the use of globals for filtering portals could lead to this kind of result.

It also depends on what you are trying to perform :

- a search for any room vacant within a period

- a display of reservations.

If there is no other solution provided by other users, I could drive you to the steps of this structure.

Posted

Ok Ugo I have read this article but I still not understanding how can I make what I'm need.

Can you drive me to the steps of this structure?

Posted

Hi Yannis,

Well, we are definitely far from your first post here.

First of all, we need to know more about your structure, as I have some doubts about it.

So you have :

Room Reservation

Plan of Rooms

Tempfile

A little example shape of the plan:

..............3/2/03....3/4/03...3/5/03

Room1....Cust1.....Cust2

Room2....Cust3.....Cust3....Cust3

Room3....Cust4.....Cust4

Question 1 : How can you have a table/portal in Plan of Rooms with a Row for each Room ?

Isn't the Plan of Rooms a file with as many records as number of rooms ? So each record for this file should be a Room N

Posted

Hi Ugo,

I suppose that to make a view plan in FM for reservations its not so easy thing. I have search the web for an example solution with FM but I couldn't found anything.

So the description of the solution is:

I have plan the solution under a "rent a car" needs but

the same needs belongs to a hotel/room reservations.

1. Car File

2. Reservations File

3. Reservations Temp File

4. CarPlan File

In the carplan file I use 2 portals one with the cars

to bring me all the cars from the related file with a relationship of a constant=1 for all the records in the car file. The second portal bring all the reservations for each car from the reservation temp file because the needing of the temp file creation was that in a line of the 2nd portal I must appear every reservation of each car and this happen with a relationship between plan and temp file bases in a constant=1 all the records in temp file have the same value in this constant. So it works like this:

Portal-1 Portal-2

........ 3/2/02..3/3/03..3/4/03

Car1.... Cust1...Cust1.........

Car2.... Cust2...Cust3...Cust3.

Car3.... ........Cust4...Cust4

The 2 portals are so close that this appear to the user

as an array with x&y axis. I dont know I am I so clear?

If I am not I can describe more details.

Thanks for your interesting.

Posted

Hi all,

Is this a limitation of FM Table structure or does anyone have an answer ?

Please have a look at Yiannis post and tell if what he is trying to perform is reasonable and possible.

Hi Yiannis, Sorry I changed the current thread title. Hope this will help getting some users to come by and help you out.

The best I could come with was a Calendar splitted by weeks&years and a Multikey set in Temp file that could relate to the Calendar according to the Reservation dates. This can lead to somehow a solution, but doesn't provide you with a solution for a one line per car.

The worst part of your solution appears for me as for each record, Customer Name should be entered or not by calculation (still based on reservation dates) in a 365 fields for CustperCarperday 1, CustperCarperday2,... next to 365 date fields per record autofilled still according to the reservation dates.

You now understand why I ask for help here as this is just the basic FM Structure noone would ever want to come accross. wink.gif

Posted

I think that I have found the solution.

Now from a line in the portal who belongs to each car, I can go to the related record in the reservation file and with a calculation index field "CarId & ReservationId" I have made a relationship and I can go to the specific reservation Id for this car. So I think with this method

I can handle a multikey definition. I am a newbie in FM any other suggestion for handling those kind of solutions it is useful for us. I will try Ugo to translate in English language a part of my solution with this problem who we discussed and make it attachment to the forum.

Thanks for your support!!!

This topic is 7991 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.