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.

script to remotely create records

Featured Replies

Before I get started I just wanted to thank mr_vodka (whom I forgot to mention) Ender, Inky Phil and comment for getting me this far.

I have three tables

Client:)

_ClientID

FirstName

LastName

H.Address

g.clientID

Property:

_PropertyID

HouseName

HouseAddress

Ownership:

_OwnershipID

ClientID

PropertyID

I within the client table I have a property assign layout. You hit the button and the P.Assign layout pops up and you choose the address. Then you hit the button and you are returned to the client layout. After you have selected the property via the address you will hit the button to 'set' and the script runs, creating a new record in the ownership layout which ties the clientid of the person you were just looking at with the propertyid of the address you just selected, and then returns you to the client layout.

This is the direction I am heading in:

go to layout - ownership

new record/request

set field - ownership::propertyID getfield (property::_propertyid)

set field - ownership::clientID getfield (Client::g.clientid)

commit record/request

go to layout - client

As you can probably see my script writing is not entirely up to par

Eider.zip

Edited by Guest
I'm an idiot

No love... sniff sniff... :)

Kibber,

In your script, both your scripts get rid of the GetField Function in the SetField steps. Also in the 'Set Selected Name on Property' script you want to set the property to gPropertyID, but you dont set gPropertyID anywhere before hand.

Take a look at your modified file. i made a few changes just so that you can follow the process better.

-John

Eider.zip

  • Author

Sorry John aka mr_vodka,

I feel horribly that I forgot you in my list.

I am terribly sorry to not have given you the credit which you so rightly deserve.

Very embarassing, indeed.

I am looking at your attachment now. Thanks for still helping me even after my goof.

Edited by Guest
english

Kibber, dont worry about it. I was just teasing ya. Always happy to help out those using FileMaker.

:)

  • Author

Excellent,

ok now I think I can spend some time making it look pretty....wait I should probably ask the boss if he wants anything else to change first

Thanks again mr_vodka

Oddly enough I know understand why you initially told me to include a unique ID in each of my tables...he he he

Edited by Guest

I have a similar (but slightly unrelated) question.

I have a form layout with global fields. The user enters in their data and hits a submit button which then creates a new record in the appropriate table, copies the data over and then returns them to the next page.

I am using the Set Field function in order to transfer the information. However, there are probably close to one hundred fields. Will I need to use the Set Field function for every one or is there an easier way?

I trial-ed and error-ed with a bunch of the scripts (copy record, select all & paste) but none of them seemed to provide me with the correct results.

Ideas?

If there are that many fields, you can do a set field for each or maybe you can do an import into the other table from those globals fields to the matching entry fields. If you are going to do an import, sake sure that your record found set is 1 so that you dont import all the records.

Thank you I will try that!

Is there a quick way to clear all fields or will I have to script the clear for each individual field as well?

I was going to suggest one method right now, but then I looked and you have FM6 correct? My method only works in 7... :-(

In 7 you have the option of having a calculated value for globals as well. If you create another global field gClearFlag, you can have the other global fields have a calculated value of, Case ( gClearFlag=1; "" ). This would allow all globals with this to default to null. However, as soon as I set gClearFlag to 1, in my clear script, I would set it to gClearFlag=0.

I'm actually using 8 pro... I just can't remember where I go to change my details.

I will look into that and see. Thanks for the advice!

I've just tried this method and now that the calculation is set up in my global field I am unable to modify it because it is basing the field contents on the calculation...

It is still a global text or number field correct?

It should only be a calculated value, not a global calculation field.

I think I need my fields to be global because I do not want to have to create records... (am I completely off-base here?)

I thank you for your help, but when I hit clear globals nothing happens.

Please download the new file and try again. I dont know why it is not working for you...

Still not working, and when I hit reset I get a bunch of error messages about my privilege set.

Very strange. Try opening the file with the Admin user name. There is no password.

Hold down shift while you are opening the file

I've noticed that the flag changes from 2 to 0 when I hit the button but all the global fields remain.

download it one more time please.

Now when I open it there is no content in the global fields.

Lets take this to a private topic until I can figure out why you arent seeing the results.

i will send you a private topic.

I would use the New Window[] script step to preserve the current found set or status quo of the user's screen and then "Get (ScriptParameter)" to set the secondary key. When user is done with the selection, close Window [].

I will look at your file on monday since I'm currently working remotely.

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.