April 18, 201411 yr Newbies Hi all, I'm fairly new to FM after only using FM PR012 for a short time now However I have managed to get past the basics OK but I'm having a hard time learning script steps. Question: I really want to learn more about script steps etc but I'm not having much luck finding books that go in to detail about the correct way to write scripts. I welcome all comments
April 18, 201411 yr FileMaker Training Series, by FileMaker Inc itself: http://www.filemaker.com/support/training/fts.html It's pretty good, with lots of exercises.
April 19, 201411 yr Consider getting hold of a general introduction into programming. FileMaker scripting/calculations don't live in a vacuum, so many techniques, conventions and best practices from other environments and languages also apply and/or are worth considering.
April 20, 201411 yr Author Newbies Thanks for the advise and I will study at the Filemaker website more closely. I do however, have a problem that I just can't get my head around. I have three related tables, they are:- CustomerDetails - OrderForm - OrderDetails. What I have been trying to do is pull the customers details into the "OrderForm" via a drop down list then auto look-up a matched field "CustomerFullName" to the OrderDetails layout. I have now decided to remove the "OrderDetails" and use this instead of the "CustomerDetails" table. But I'm still having trouble trying to automatically pull the details from a matched related field to the "OrderForm". Hope this makes sense.
April 20, 201411 yr If you have these tables Customer --< Orders --< LineItems you need • a primaryID in Customers • a primaryID, and a foreignID for Customer in Orders • a primaryID, and a primaryID for Orders in LineItems Create a relationship Customers::_pk_customerID = Orders::_fk_customerID. Use a value list defined as Customers::_pk_customerID as the 1st, and Customers::name as the 2nd field, and use it to format the foreignID field on your Orders layout. When you have inserted a customerID into the foreign ID field, you can display the customer's details, simply by placing fields from the related Customers table on the order form layout. I have now decided to remove the "OrderDetails" and use this instead of the "CustomerDetails" table […] Hope this makes sense. No. If your orders consist of more than one product, you need a LineItems table (aka Order Details). Also, this has nothing to do with being able to display the customer name on an order. Also, when you say “pull”, you hopefully don't mean “copy” – as emphasised above, don't copy data from related tables – reference and display it.
April 20, 201411 yr Also, when you say “pull”, you hopefully don't mean “copy” – as emphasised above, don't copy data from related tables – reference and display it. With a couple of nuances: You typically want your invoice to display the customer's information AT THE TIME of the order/invoice, not the most current information. In case they move, change legal name,... Same applies to product prices. You do bring the product price over to the order line items to capture it at the time of the order. Otherwise, when the product price changes all of your old orders will now show the new price and not the price at the time of the order.
April 20, 201411 yr Author Newbies With a couple of nuances: You typically want your invoice to display the customer's information AT THE TIME of the order/invoice, not the most current information. In case they move, change legal name,... Same applies to product prices. You do bring the product price over to the order line items to capture it at the time of the order. Otherwise, when the product price changes all of your old orders will now show the new price and not the price at the time of the order. Yes, you are on the same track as me. I must admit that when I started this project, I did not realising how complicated it might get! My thinking is - yes I could use a portal but due to very long list of options and upgrades for each product item I'm faced with, a portal was (as far as I could see), out of the question. So. I'm trying to retain the customers ID and/or full name in the orderdetail layout when each record is saved, which will be my line items. And you are correct in your comments (above), that's what I have also tried achieve, that's why I was looking at the option of a look-up field.
April 20, 201411 yr Typically the selection / creation of line items (order items...) can be scripted so that you do not have to rely on burying business logic in the field schema. Auto-enter and lookup settings are on the field level and generally it's better to avoid that and take explicit control over what gets set when. With auto-enter and lookups you do not always have that same control.
Create an account or sign in to comment