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.

Set field Question

Featured Replies

Hello Everyone,

I'm sorry if this is an easy problem. I'm pretty new to scripts, but o.k. with FM in general. I looked through alot of the old posts but still couldn't figure out how to make it work for my situation, or just didn't understand.

Setup - I am trying to develop a database for my company that can create pieces for assembly. Each piece is unique but many pieces may combine to make a bigger item.

Table1=Piece Builder

Table2=Burning Details

Table3=Sawing Details

Table4=Purchase Details

The tables are relational through field "Piece Number"

I want our engineer to start with "Piece Builder." Be able to find a job # from another order entry table(not important here) such as Job #1001, then assign a Piece # like 1001-1, then push a button to go to one of the three tables, as order requires, and auto-enter the same Piece # from "Piece Builder" table. From there he can enter what needs to be done to each piece. I have been able to write a script to open other table and create a new record(pretty easy) but cannot figure out how to auto-enter piece number. Have been trying to use SetField[] command but can't seem to get it to work.

Please Help!

Hi abomb,

it would work if you would have two seperate fields in the piece-table and a claculation:

On the builder table:

Field: kP_BuilderID - auto enter serial number

Relation: kP_BuilderID -< kF_BuilderID in piece table

(allow creation of records)

Portal with piece table fields.

On the piece table:

Fields:

piecenumber - auto enter serial number

kF_BuilderID - auto-entered when entering pieces in builderportal

builderpiece - calculation: builderlink & "-" & piecenumber

Actionfield - what needs to be done

Any help?

reg. Hartger

  • Author

Hey Herrix,

Thanks for posting so fast, but I'm sorry, I really don't understand. Maybe I don't understand FM as well as I thought. I don't want the "Piece Number" field to auto enter. It is based on the "Job Number" such as Job # 1001 would have Piece # 1001-1 and/or 1001-2, etc.

"it would work if you would have two seperate fields in the piece-table and a claculation:"

I don't quite understand. Do the two fields have different Names on the "piece builder" table? or are they two different tables? If they are, I still don't understand how to set up the script for it.

Again, I would like to have just one table for the Job # info. This could then be used to create pieces, linked with the total job. Maybe I did a bad job explaining, but could you be a little more detailed and dumbed down in your explaination. Again, I guess I don't understand FM as well as I thought, or at least all the short hand.

Thanks again for any help.

I think what he is saying is that you would make a "dummy" serial number in the piece builder table, and then make the piece number a concatenation of the job number and the serial.

You would have to re-set the serial number in the piece builder table for each new job, though, and if there are several jobs happening simultaneously, you have to have a field in the jobs table that keeps track of what the next piece number is for each job. I do something similar for assigning lab sample numbers, and am trying to figure out how to do this via a script step, which I have no been able to get to work so far. I have a question on another thread about this, maybe I can be of more help when this question is answered.

  • 2 weeks later...

You wouldn't have to reset the piece number, it'll be easier to have it running as a serial number.

As I understood, several jobs can have the same piece number...

Job # 1001-23 would be the same piece as Job # 2043-23.

For the rest, you're right, concateating is the trick.

still helping?

Herrix

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.