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

Adding portal records


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

Recommended Posts

Posted

Hi there,

I have 3 tables: Orders, Order Lines, and Items.

On the orders layout I have an Order Lines portal. I have a transparent button on top of the portal row and a platform below the portal for adding, editing and deleting records. I can delete portal records from a button on the platform. Yeah!

I would like to add new Order Line records by selecting Items from a drop-down on the platform. I think I need to establish a working relationship between Order Lines and Items. I have a relationship, but since there are no Order Line portal records yet, there are no Items showing up in the drop-down! Do I need some kind of utility relationship? How do I do that?

Thank you in advance.

Hal

Posted

I'm sorry, I'm a newbie and I'm confused by a lot of the Filemaker terminology. It's not for a lack of trying: I've read the Filemaker Pro 9 Bible and the "White Paper for FMP Novices" by David Kachel. I got the term "platform" from page 19 of that white paper. I take "platform" to mean a group of fields on a rectangular "platform". In this case, my platform is below the portal.

The layout uses the Orders table, the portal on the layout uses the OrderLines table, and I'm trying to add a drop-down of a value list from the Items table on the platform below the portal. But I can't get any items to show up in the drop-down. I think the problem is on the "display data from" side of the Field/Control Setup of the drop-down.

Posted

OK, I got the drop-down to work again.

Now, when I choose an Item from the drop-down, I want to run a script that adds a record to OrderLines and sets the values of the fields in the new OrderLines record with values from the chosen Item record. I have the script.

I tried "Button Setup" on the drop-down and added the script there, but then the drop-down stops working.

Can someone please tell me how I can get this to work, or point me to some examples?

Posted

Here's what I'm assuming: you click a portal row and populate a global field with the recordID of the child record in the portal. Then, using a relationship from the parent Order to the child OrderLineItems matching on OrderID and the globalID, you display the child record in a separate set of related fields on this "platform". Btw, that's just an interface technique. There are many other options for editing a child record without leaving the parent form. You can, for example, just edit the record directly in the portal row.

So, the problem is the drop-down value list. You say it's not working "I can't get any items to show up in the drop-down." Is the value list created from a table occurrence of Items and NOT a related TO? Does it include the ItemID and its Description as the second field? Do you have "show only second field" checked?

If you are only showing the second value, you will not be happy with a drop-down list. Drop down lists show the first value in the vl after a selection. So, you'll see the ItemID. Try switching to a popup menu.

Posted

Thanks for the response. I'm making progress. My problem with the drop-down was caused by a relationship problem. And you are right about the drop-down list: a popup menu *is* much better in this situation.

But tell me, am I stuck in a non-Filemaker paradigm?

I don't want to to edit records directly. I want to select a record from a portal row (I have this part working), then click the Edit button to open a second window for editing. (Adding a row is similar except portal row selection is not relevant.) This second window for adding/editing has all the editable fields and a Cancel button and a Save button. Is this feasible as a Filemaker solution?

To hold the data temporarily while editing, should I use a separate table, or should I use global fields? If global fields, which table should they be in?

I really appreciate your help.

Posted

You're fine using the "platform" idea. I don't often ship solutions with direct edit in a portal.

My portals usually have an Edit button to the extreme left in the portal row. This button does a gtrr, new window, using an Edit child layout. I usually have a Done button.

Cancel buttons are a bit tricky. A true Cancel would throw out any edits. Does yours?

There are at least two ways to do this:

1. Use all global fields in an Edit layout. User clicks Edit. Script sets all globals to the corresponding field values. Cancel just closes the window. Save sets the respective fields to the globals.

2. Capture orig field values in $vars when user clicks Edit. Cancel sets the fields back to the values stored in the respective $var and closes. Save just closes the window (thus committing edits).

Posted

just curious; using the popw/$ construct, how do you handle the user closing the popw, i.e. using the system window close buttons, after editing a field or two?

Posted (edited)

You need to Allow User Abort Off and Pause right after the new window. That'll make the popup modular. They'll need to click your buttons to continue the script and close the window.

EDIT: Also, you may need to use custom menus to map the Close command to a beep, so that it doesn't Close. This is how to disable the red x.

Edited by Guest

This topic is 5821 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.