Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I hope someone can help me with a script that I'm trying to write. While in my Customer database I would like to select the account number of the current record then open my Orders database and copy the account numer into the Account No. field. I tried the following script:

Copy [select; Customers::Acct No.]

Open File ["ORDERS"]

Go to Layout [original layout]

New Record/Request

Paste [select; ORDERS::ACCOUNT NO.]

but all it does is open a new record in Orders and places the cursor in the Account No. field. I know I'm overlooking something, but I don't know what. I've tried different things with no luck. Thanks.

A couple of questions

1) Is there any reason you have created a seperate database for orders?

2) Is this a single user solution?

  • Author

Yes, this is a single user solution. I thought I had to use separate databases and join them together to keep track of customers amd their cars and pull that information into my order form. Is it not possible to use a script to work between databases if they are joined?

It is possible, but probably not very useful in the way your using it.

It's useful for splitting things like interface and data, reports, and data modules in very large solutions, but probably not in something this size.

In something this size, you will save yourself a lot of effort by just using one file with many data tables. E.g. one file, 3 tables, People, Orders, Cars .. then just join people and cars through orders.

  • Author

Sorry to ask this question again, but I'm still having a problem with a script that I'm trying to write. While in my Customer database I would like to select the account number of the current record then open my Orders database and copy the account numer into the Account No. field. I tried the following script:

Copy [select; Customers::Acct No.]

Open File ["ORDERS"]

Go to Layout [original layout]

New Record/Request

Paste [select; ORDERS::ACCOUNT NO.]

but all it does is open a new record in Orders and places the cursor in the Account No. field. I know I'm overlooking something, but I don't know what. I've tried different things with no luck. Thanks.

I would try to stay away from copy and paste. Why should you litter up your user's clipboard unncessarily. A better way to handle it would be to use a global field to temporarily store the acct number and then use a setfield.

You will however have to either move the tables to your main file (then you can use a variable), or add a file reference to your other file to use the method john suggested.

It can also be handled this way, make two scripts:

1) In the Customers file make a script called Transfer:

If [ IsEmpty ( Get ( ScriptParameter ) ) ]

     Perform Script [ “Transfer”; Parameter: Customers::Acct_no ] 

Else 

     Open File [ “ORDERS” ] 

     Perform Script [ “createNew” from file: “ORDERS”; Parameter: Get ( ScriptParameter ) ] 

End If
 



...and 2) a script in the ORDERS file, which goes:




New Record/Request 

Set Field [ ORDERS::AccountNumber; Get ( ScriptParameter ) ] 

But I fully support John and Alex that the task at hand better are dealt with utilizing $variables as well as a proper relational structure where Customers are related to Orders.

--sd

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.