Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

  • Newbies
Posted

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 

Posted

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. 

  • Newbies
Posted

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.

Posted

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.  :laugh: 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.

Posted

 

 

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.

  • Newbies
Posted

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.

Posted

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.

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