Jump to content
Salesforce and other SMB Solutions are coming soon. ×

Repeating fields and portals


Chrisf776
 Share

Recommended Posts

Hey All,

 

I'm a total filemaker newbie. I've been learning to use filemaker over the last few days. I have some data stored in repeating fields that I'd like to view from a portal. Does anyone know how to make the portal point to a repetition other than the first? For example, I am storing the prices of items ordered on a particular day in one field with 15 repetitions (so I can accomodate up to 15 items ordered). The quantity and name of each item are stored in two parallel fields, each with 15 repetitions. If I want to use the portal to access the 2nd repetition in the price field, the 2nd repetition in the name field, and the 2nd repetition in the quantity field, how would I go about doing this. So far, I can only get the portal to point to the first entry (repetition) in each field. Thanks for your help!

Link to comment
Share on other sites

Hi, Chrisf!

If you use repetition fields, why you want to see in the portal.

You mast choose one:

1. using portal with relationship(having Invoice table and Items table with relation between them by Invoic_Number)

2. using repetition fields in curent record with creating form for this record. In the record you must have name,quantity,price and amount and show this fields in the form in this order(horizontaly)

The first way is better.

Link to comment
Share on other sites

hi chris

 

I'm not really sure what you're trying to do, but try

 

GetRepetition(RepeatingField ; RepetitionNumber)

 

I do feel compelled to start the usual lecture about repeating fields. They are a leftover from the early days when filemaker was not relational.

It makes more sense to set up your database so that you can have lineitems, where one item ordered is represented by one record. These can be viewed in client order forms, etc.

 

Repeating fields can be useful in some instances, but not this one.

 

If you need further assistance, please post again. Then describe what kind of database you're trying to build more explicitly. There are lots of people around here who can help :)

 

kjoe

Link to comment
Share on other sites

Hey all,

 

Thanks for the replies! A little more detail about what im doing...I trying to build an orders/inventory database. Basically, my main data table is a purchase order form with several items to be purchased from one vendor. The vendor info stays the same for each item, but the items to be purchased change. I'm using the repeating fields for the individual items. I have a few parallel repeating fields such as item catalog #, item name, item quantity and item price. I also have another main table that is an inventory database which stores detailed information (description, usage, etc) about the items that are ordered. I'm trying to use the portal as an easy way to view the order history of each item when browsing the inventory. Basically, I set the portal to grab a few pieces of information from each record that matches in catalog number and vendor. The portal is correctly pointing to fields that don't repeat, but its only pointing to the first entry of each repeating field. I'm using FMP7 btw. Thanks for your help...again.

Link to comment
Share on other sites

I agree with kjoe; this is a situation for line items, not repeating fields. There are many users on these forums (myself included) that can help you set up a system with line items.

 

As for the repeating fields question, I haven't the slightest. Sorry.

Link to comment
Share on other sites

I can definitely see how line items are a better solution. The problem is that my invoice form is already setup and i dont want to mess with it. I'm going to try add a new table to store the data for each item but i'm not sure how to...1) put the invoice number I enter into my top level form/table into the record for each item I want to order on that invoice, 2) how i create a new record from my invoice form each time i start typing in the area I want to enter new items to be ordered. Also, the way I have it setup right now, the catalog number (repeating field) and vendor name must match in order for an item on a particular invoice to show up in the portal to the inventory page. That means that filemaker is at some point searching the catalog number field (repeating) and finding the matching repetition (this works). Anyone know of a way to count which repetition was the match? I could then use that number to match up the rest of the data like quantity and price. Thanks again. - Chris

Link to comment
Share on other sites

I still think you'd save a lot of time, work, and confusion by just setting up the line items system now. It doesn't take very long to set up a system to replace repeating fields. Additionally, it seems less complicated than the methods your trying to use in order to keep a repeating field implementation.

 

Just my 2¢. Good luck with whatever you decide to do.

Link to comment
Share on other sites

I don't have a template, but I can write a brief outline for you to use to get started.

 

Tables/Relationships

Order line items inventory

 

Relate orders to line items by OrderNumber. Relate line items to inventory by ProductNumber (or if you want to get more complex, I can walk you through the steps for setting up complex relationships).

 

Display line items in a portal on the order. That way you can add/delete line items right from the order. The line items should have fields for Name, ProductNumber, Price, Quantity, and any other details that are specific to that instance of the item being ordered. You'll want to have things like price and name as lookups from the inventory table so that it stores the price that was current at the time of the order; that way your records aren't changed if the price of an item changes. Dig?

Link to comment
Share on other sites

I got the layout and relations down, but i'm not quite sure how to enter data via the portal. For now, i've got a separate data entry page, but i'd like to be able to enter data directly into the order form (like it was with repeating fields). Also, anyone know a way to start a new record but not save it until the user confirms all the entries? Thanks again. - CHris

Link to comment
Share on other sites

A little clarification, I can edit existing records in the line item table, but I cant figure out how to make new ones when im doing data entry directly into the order form.

Link to comment
Share on other sites

To confirm that all fields have been filled, you could write a script to create a new record, check for any empty fields, and then offer to revert record or finish completing the record.

 

You could also set all your fields to validate as non-empty; you can't click away from the record until you fill all of the fields.

 

If anyone knows a third, and possibly better, way, please share!

Link to comment
Share on other sites

You think the revert record script would work since i have portals to other tables in my one top level layout?

Link to comment
Share on other sites

I can't remember off the top of my head if revert record changes related records as well.

 

The more I think about it, the more it makes sense to just set all your fields to validate non-empty. I might be wrong, but it seems faster and less of a hassle than having a script check your whole form.

Link to comment
Share on other sites

Also, anyone know a way to start a new record but not save it until the user confirms all the entries? Thanks again. - CHris

 

Hardline I don't know if this is a question that exactly points to validation. Besides that strict validation for a multifield layout may drive your users crazy, see here. notably post #90 by Ender.

 

A possiblity is to uncheck the "save record changes automatically" option in the layout setup dialog. FM will also ask to update if a portal row has been changed.

 

Scripted data entry is in my view more user friendly than validation settings and can handle most if not all validation requirements. But there is a difference between validation (which protects data integrity) and asking a user if he's sure of his record modifications (which is about content).

 

kjoe

Link to comment
Share on other sites

 Share



×
×
  • Create New...

Important Information

Terms of Use