Jump to content
Server Maintenance This Week. ×

Pasteing into a pop-up menu


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

Recommended Posts

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
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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