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

Featured Replies

I am at my wits end on this one. I have 2 files that are linked with a "constant" relationship. One file is a "holding tank" for production numbers that are being entered in the main file. When the user clicks on "submit button" in the main file some of the information needs to go to the "holding tank" file. I have a set script that sets all of the fields in the "holding" file with information from the main file. The script resides in the "holding" file and when the user clicks on the submit button in the main file it calls for the external "set" script which is ???

Enter Browse Mode

Set Error Capture (On)

If (Main:Hourly production >0) (This steps checks to make sure that production is entered to complete the script)

New Record/Request

Set Field (A, Main:A)

Set Field (B, Main:???

Set Field (C, Main:C)

Set Field (gcurrent, Status(current error)

Else

Exit Script

End If.

My problem is that it will not set field C with the information. It leaves it blank. I put on the error capture and the result is "0". I cannot understand why it will not set field C. Field C in the main file is a number field as it is in the "holding" file. The only thing I can think of is that in the main file Field C is a conditional value list, but the data that is entered in C should still be set , right?

Help.

How many records in the Main file? If the relationship is constant it will pick up the values from the first match, not necessarily the current record.

However, as you not it sets A and B. Turn off error capture and run the script and see what happens.

Let us know, then maybe we can further diagnose. Also be sure that field types are exactly the same in both files.

Old Advance Man

  • Author

There are 100 records so far in the main file. Both "C" fields are formated exactly the same. I tried the script with the error capture off and I get the same result. I also tried turning off the indexing for the "flag field" and it then would not set any information. Is there another way around this besides cut and paste. My main file has 7 other small files working with it besides the holding file and none of the other databases can be "viewed" by the users. The data being transferred to the "C" field in the holding file is data needed to generate daily, monthly, and yearly reports.

The problem is likely with the constant relationship. Create three globals fields in the main file to match the A, B, and C fields. have the script set the values from A, B, and C into the correeponding globals.

SetField "global_A", A

THen access the globals from the other file to have the data set into the records there.

HTH

Old Advance Man

  • Author

This worked. Thank you very much.

quote:

Originally posted by MEG:

I am at my wits end on this one. I have 2 files that are linked with a "constant" relationship. One file is a "holding tank" for production numbers that are being entered in the main file. When the user clicks on "submit button" in the main file some of the information needs to go to the "holding tank" file. I have a set script that sets all of the fields in the "holding" file with information from the main file. The script resides in the "holding" file and when the user clicks on the submit button in the main file it calls for the external "set" script which is
???

Enter Browse Mode

Set Error Capture (On)

If (Main:Hourly production >0) (This steps checks to make sure that production is entered to complete the script)

New Record/Request

Set Field (A, Main:A)

Set Field (B, Main:
???

Set Field (C, Main:C)

Set Field (gcurrent, Status(current error)

Else

Exit Script

End If.

My problem is that it will not set field C with the information. It leaves it blank. I put on the error capture and the result is "0". I cannot understand why it will not set field C. Field C in the main file is a number field as it is in the "holding" file. The only thing I can think of is that in the main file Field C is a conditional value list, but the data that is entered in C should still be set , right?

Help.

  • 2 weeks later...

OK, so I read this thread and I got the Set Field script step to work correctly in my application, but I'm still confused. I began this undertaking believing that all I had to do was use Set Field to set the contents of a field in File B to the contents of a field in File A. I could never get the field to set any value.

I studied the examples in Scriptology (book) and in Schwartz' book, I read this forum in depth and I was sure I was doing it right but it just never worked. I finally resorted to using a global and it worked just fine. (I did get it to work with copy-paste but that wasn't what I wanted, for a number of reasons.)

I saw several places on this board where people were having trouble Setting a Field to the value of a field in another database. Does this just not work? Is it a known bug? If not, what (perhaps undocumented?) condition has to be met before it will work correctly?

Stop! Set Field() is 100% reliable!

It is just being used improperly. The contant relationship should not be used to set anything except GLOBAL fields in a related file. This is the cause of your problems. If you want to set other than global fields, use a two step process:

In your first file ---> Set Field(GlobalField, RealField)

then in the second file ---> Set Field(RealField2, ConstantRel::GlobalField)

-bd

quote:

Originally posted by LiveOak:

Stop! Set Field() is 100% reliable!

It is just being used improperly. The contant relationship should not be used to set anything except GLOBAL fields in a related file. This is the cause of your problems. If you want to set other than global fields, use a two step process:

In your first file ---> Set Field(GlobalField, RealField)

then in the second file ---> Set Field(RealField2, ConstantRel::GlobalField)

-bd

I agree with LiveOak. The Set field script step is 100% reliable. The problem Meg was running into was that, by using a "constant" relationship, she was Setting fields in the first record of the related file regardless of her creation of a New Record in the related file.

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.