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.

Pasteing into a pop-up menu

Featured Replies

I need a script to select a primary key value on one layout, and paste it into a join record on another, in a field that is a pop-up menu.

In context one table is for Presenters, another books Presenters to take adverts, whilst a final layout details each advert. Rather than have to search through hundreds of Presenters on the join record, I want to use a button on the presenters page to open a booking record and paste the name in.

I'm sure there is a simple answer to this on but can't find and answer on the forum.

Advise appreciated.

script.jpg

Edited by Guest

Why use copy/paste? It destroy whatever the user had on the clipboard and FM has so many other ways of passing data around that it's really not needed.

Have a look at the "Set Field" script step. Since you already have a variable set to what you want as the target field value, just set the target field to the value of the variable...

  • 2 weeks later...
  • Author

opps, didn't realise this had been replied to. I'm still struggling a little with this. How do I set the target field to the value of a filed on another layout. I have tried putting "Presenters::PresenterID" in the calculation field, but just pastes "Presenters::PresenterID" in the find field.

I want to the script take the value from the field, in the record that the button is pressed in.

Hi Dan

As Wim said you can use the set field script step to achieve what you want. The advantages are that you do not need to be on a layout that contains the field that you want to set and you do not need to use the clipboard.

eg to set a field in a new record from a field in an existing record, go to the record that you wish to transfer data out of then:

set variable (your variable;source field)

create new record

set field ( target field;your variable)

That should do it

HTH

Phil

As an after thought I just noticed that the heading to this question mentions a pop up menu. Why do you need to give the user a menu if you are auto filling the field ?

Phil

  • Author

Great got that working and also using it for a script to edit records from a portal i.e

Select a record in the portal, set its id as the variable, switch to the full record view, enter search mode and setfield to the variable.

One problem, I have to manually press the return key, this is also the case to the booking script I was previously trying to get working.

Is there a way to script a return?

Also have tried using the perform find script step, setting "Find records when" to the field I need to query and the "Criteria" to $variable. When I run the script I get $variable in the search field not the variable.

Appreciate your help

Daniel

  • Author

Phil,

The record is auto filled, if the user books from an individuals record, they can manually find an individual on the booking page, if they need to.

The other reason is to prevent changes being made manually to the name, I can't work out a way to lock the field and allow data to be writen to it from the variable.

Thanks

Daniel

Select a record in the portal, set its id as the variable, switch to the full record view, enter search mode and setfield to the variable.

One problem, I have to manually press the return key, this is also the case to the booking script I was previously trying to get working.

Is there a way to script a return?

Daniel

Dan

I am not working in 8 so I do not have the 'find record when...' option but in earlier versions, at the point at which you press return in find mode, a simple 'perform find' step would do the equivelant of pressing return

Phil

  • Author

Phil

Think I was just trying to be a bit to clever, setting up the variables, just put the script step in unchanged and there we go,

Thanks for the help.

Daniel

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.