Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

This has proven to be a real mind bender for me. I thought I had a solution but it doesn't work, and figuring it out seems to be above my skill set.

So....I throw myself to the mercy of the list for assistance.

I have a DB where my client wants to be able to view the contens of prior records as they relate to a new record, based on a match between the clients "customers name" and a "design number" that belongs to that customer. So when a customers name is entered in the "Name" Field, and a number is entered in the "Design Number" Field a realtaionship shows the resulting occurences.

That is easily done trough a portal.

The next part though is where it gets tricky for me.

The client then wants to copy the contents of 12 fields in the portal(colors 1 - 12 respectively)into the "new record". An added twist is that there may be more than one record related, so the portal will display as many rows as I have set it to, combined with a scroll bar if it exceeds the set number.

It is obviously easy to do with a manual copy and paste (click desired field in portal row, CTRL-A, CTRL-C, click field in new record, CTRL-V) but my client has asked me to automate this in a script.

Can this be done? I'm stumped! Is this one of those easy things that I should know, or is this actually as complicated as I have unsuccesfully attempted to do?

Customer does not want to simply "duplicate" prior record, as each record has several lines that may or may not be included in the new record.

Thanks for any help,

Steve

Posted

Hi, Baylah!

If you have record and his portal records, and you want to dupplicate it you must:

1.Know the next record Id

2.Duplicate all portal rows and change Id of duplicated rows to the Id of next record

3.Duplicate main record and set his Id.

I did it in my works, and this question is actual to many programmers.

Posted

Hi, Baylah!

If you have record and his portal records, and you want to dupplicate it you must:

1.Know the next record Id

2.Duplicate all portal rows and change Id of duplicated rows to the Id of next record

3.Duplicate main record and set his Id.

I don't follow, I'm sorry :B

Steve

Posted

You should try to normalize your structure as much as possible to eliminate the need to keep multiple copies of the same data in multiple records. Things that have to do with Customers are kept in the Customer table, and things that have to do with a design are kept in a Design table, etc. If a particular design gets used multiple times, then a join table may be appropriate to join those occurences.

Posted (edited)

Ender,

With all due respect as I am certain your FMP programming skills are far superior to mine, I don't think your suggestion is valid in this case.

I don't want to bore the list with detail, but in this instance: my client uses his database to keep track of production records in his contract embroidery company. When an embroidery production record is created a "Design Number" is entered and a Sequence of Color information must also be entered. That color sequence information "might" be different for a black shirt, a white shirt, yellow, green, whatever.

The design number and "default" color sequence is stored in a seperate table (as well as other information that is design related but not production related. But by deffinition "default colors" will not work in every situation, and for my customer to try and think of every possible color sequence combination based on an infinite list of potential garment colors is asking too much. A design number might be used once or twice a year, maybe only used once ever, or it might get used everyday, it is impossible to say.

As a result, my client asked me to give him a method to "copy" information from a prior production record when there is a match based on "Customer Name" and "Design Number".

FMP "displays" this production "history" information on a "current" record elegantly in a portal but the trick then becomes getting the information out of the portal, and set into the current record.

I can easily accomplish this in a "two step" instruction (enter a related production order number into a global field, then click a scripted button to do the rest. But in the interest of developing user friendly interfaces I was trying to write a script that would do this by clicking "just one button."

If anyone has any suggestions I would appreciate it. I struggled with this all last night and could not come up with a solution.

Thanks,

Steve

Edited by Guest
Posted

Am I missing the point here?

In your portal your are showing the values of 12 fields and you want to create a button which will transfer the 12 fields into a matching set of 12 fields in the main record?

Doesn't the following work?

Turn one of the fields in the portal into a button. When it is clicked it selects the portal row as a related record and you can then simply transfer the data by a sequence of SetFields

SetField(Main::field1;related::field1)

...

SetField(Main::field12;related::field12)

where related is the name of the table used in the portal.

Posted

That was it! I was not aware that you could use "set field" inside of a portal in that method.

Thanks, I knew it was something simple.

Steve

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