September 10, 201213 yr Newbies I have a database with 3 tables. Customers, Service Calls, and Service ques. This question is about making a button that will move all of the customer information from the customer being viewed on the customer table, into a new record on the service table. So for example, if company A calls in with a broken machine i want to look them up on the customer table and then click a button that will go to the service calls layout, create a new record for this service call, and paste all of the relavant customer information into the fields so that each customers service call gets a new line that i can have a line for each service call. thanks, Justin
September 10, 201213 yr In a script . 1) Set each item you want to copy as a variable 2) make a new window 3) go to layout 4) new record 5) Set each field to the corresponding variable Done.
September 10, 201213 yr Hi Justin, No need to copy all Customer info into Service Calls - only copy the Customer unique ID. Since the tables are (or should be) related, the Customer data can simply be placed on your Service Calls layout. Some Customer info may be copied if needed for audit/history purposes. So pseudo-script might look like this firing from Customer layout: Set Variable [ $ID ; Customers::CustomerID ] Go To Layout [ Service calls ] New Record Set Field [ Service Calls::CustomerID ; $ID ] Commit ... set any other fields directly such as... Set Field [ Service Calls::Address ; Customers::Address ] ... then either stay on this layout or return depending upon your need. You need relationship as: Customers::CustomerID = Service Calls::CustomerID Oh, and welcome to FMForums! :-)
September 10, 201213 yr Author Newbies Thanks very much for the welcome and for the help. I have another problem that we can tackle some other time.
Create an account or sign in to comment