Skip 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.

Script to add field?

Featured Replies

I couldn't find any info on this in searches, I apologize if this topic has been discussed before.

I have a file that manages job sites for an elevator company...What I need to try and do is create a button that adds a field to a layout. Unfortunately I am the only person using the db that is familiar with FM so asking people to create a new field in layout mode isn't really practical.

For example-

I have 10 fields labeled "Passenger Car1" - "Passenger Car10", However 10 maybe more than enough fields for a project, or not nearly enough for others. I dont mind displaying 10 fields for the projects that have less than 10 Cars, but I need to write something that will add "Passenger Car11" and up when needed.

Any recommendations??

Thanks!

There is no way to script this.

You would need to give access to someone to edit layouts, give users the choice of a 10 field layout or a 15 field layout, etc., or give them a 10 field layout with the option to choose which fields are displayed.

There is no way to script creating a new field. Also you should rethink about how your database is setup. Instead of creating 10 fields for car1 through car10, you should have a related table that has the cars in it. In other words, currently it seems as though you have a setup where in a Table called Projects you have the following:

Projects

ProjectNum

ProjectName

PassengerCar1

PassengerCar2

PassengerCar3

...

What you should have are at least two tables

Projects

ProjectNum

ProjectName

Cars

ProjectNum

PassengerCar

By setting your database up like this, your users can enter as many or less cars as they want.

  • Author

Thanks for the quick reponses!

Perhaps a second table would be the way to go.. but I am not totally convinced.

Right now I have each job as its own record. The first layout is Job Description, 2nd layount is Cars, 3rd Layout is Hydraulics, 4th layout is Escalators, 5th is Permits, and the 6th is Layout Drawings.

I am still learning FM, I do undertand tables, but I am not sure I get the advantage of doing a different table in this type of layout. Would you mind explaining? I am still trying to figure out the best way to do things in FM.

Thanks again!

Get convinced! What you describe is the reason Relational Databases were created. When you start thinking I need the same field repeated X number of times for each record, 99% of the time those records should be in a seperate table.

You have a Job and each Job can have 0 to X (10? 15?25?... maybe only 1) number of Cars, the cars then belong in a seperate table.

I have attached a sample file. You should also start looking at the help file, try a search for "About single-criteria relationships".

MyDB.zip

  • Author

Ok.. your example makes sense to me. And I do understand how that works. But I dont think I explained this as well as I should have.

The cars aren't make or models, its actually how the contractor groups them for installation. For Example- Maybe he will choose to install passenger cars 1-6 at one time, 7-10 6 months later, and service cars 6 months after that. I need to designate that grouping. Some jobs maybe do them one at a time. So its always different... I dont know if I could set up a car table because of that.

Or am I misunderstanding this?

Can you upload an empty copy of your database or at the very least create a quick sample of how your database is set up?

Ok.. your example makes sense to me. And I do understand how that works. But I dont think I explained this as well as I should have.

The cars aren't make or models, its actually how the contractor groups them for installation. For Example- Maybe he will choose to install passenger cars 1-6 at one time, 7-10 6 months later, and service cars 6 months after that. I need to designate that grouping. Some jobs maybe do them one at a time. So its always different... I dont know if I could set up a car table because of that.

Or am I misunderstanding this?

Yes, you are misunderstanding. The dedicated field number (Car1, Car2, etc) are absolutely positively NOT the way to do this. Also, you have added some further information about scheduling that suggests that you need to make further refinements in your interface, so you can indicate the install date or service dates. You may want to learn about the subject of "filtered portals".

I might consider adding the Group, Installation Date, and Last Service Date as attributes of the Cars table. By that I mean, add fields for Group, InstallDate and LastServiceDate.

As a further point, if the Service schedule is at fixed intervals (e.g., six months, as you imply), then you could create a calculation that would identify when each Car should next be serviced, based on LastSvcDate and InstallDate. Then, your staff would simply note the LastServiceDate for the different cars, and a report of Cars needing service can quickly be built.

David

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

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.