Jump to content

Set field Question


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

Recommended Posts

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 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

Link to comment
Share on other sites

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