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 may be the biggest dummy around but... I have more problems getting the set field script to work. Are there some special rules which I am not aware of which aren't listed in the manuals and tutorials? I know I have to have a relation between tables to use it between two tables, but my calculation never ever gets placed in the field it's supposed to set! They are both number fields, no other relations, no other validation. This is driving me crazy! confused.gifconfused.gif

Perhaps you could elaborate and give some specific examples of your problem. The basic use of Set Field is fairly simple Set Field [fieldtoset; fieldorcalculationortext].

  • Author

Ok..I have two different tables

NewDesign & Rooms

The new design table has an autoserialized field (designser_pk). I need to get the current # in that field and place it in the corresponding field (designser_fk) in a layout on the rooms table so that the rooms are tied to the serial number created in the other table. I made a script which

Go to Layout-New system design

Perform find

sort records

go to last record

set field [rooms::designser_fk; Newdesign::designser_pk]

go to layout room_layout

based on my figuring that should place the last records value from newdesign designser_pk into the rooms designser_fk field shouldnt it?

Yes, but it will place it in the first related record's field, based on how rooms is related to Newdesign.

  • Author

Thats just it, even when there is only 1 record it still won't show up.

If rooms is related to Newdesign based on pk to fk, then there would appear to be no related record when you're setting the fk.

Usually what you want to do is set the parent key in a global. Then you go to the other table, create a new record, and set the foreign key with the global's data.

hi joe - instead of using a find in your script, try using the get related field step and choose the relationship you've specified between the two files. Set up a new script and test it first by just specifying that step, then checking the results in the other file. hth.

Tony

  • Author

Hey Tony. Thanks for the input but I don't have a get related field step in my scrpts. I have get related record but it doesn't seem to let me specify a certain field. Am I looking in the wrong area?

Sorry, yes, get related record is the step you need.

T

Go to Related Record is the step, but I don't see how it would help you in this situation. You are showing all records and then finding and setting the most recent one's data to a (currently) non-related table.

Hmm, I was getting from his first post that the tables were related. Is that right, Joe?

Tony

<Reread thread> I see now what you meant - the first two tables ARE related and you're trying to relate the other table to that same key. You need to do what -Queue- said below.

Usually what you want to do is set the parent key in a global. Then you go to the other table, create a new record, and set the foreign key with the global's data.

Tony

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.