Jump to content
Wayne Irvine

Change field in portal row

Recommended Posts

I have a FileMaker layout with a portal to another table. The relationship shows all unassigned records (related < 1). On each portal row I have a button which runs a script. The idea is that when you press the button the a value from the main record is copied and pasted into a field in the portal row (and as a result the portal record becomes 'assigned' and is removed from the portal.

I have the button running a script and pasting the value from the main record but it is pasting it in the first portal record, not the one whose button was clicked.

Is there a simple way of having the value pasted into the portal record where the button was clicked or do I have to store the record number (or something) and paste back to that record?

Screen Shot 2017-01-10 at 6.29.19 pm.png

Share this post


Link to post
Share on other sites

Why don't you post your script, so we can see? Offhand, I would say that a simple:

Set Field [ Related::SomeField ; Main::SomeValue ]

should suffice; as long as the button is in the portal, this will operate on the related record shown in the portal row where you clicked.

Share this post


Link to post
Share on other sites

On a further issue, how do I get the page to refresh? One portal is showing available records and the other, liked records. When I Set Field to the value of the main record it is no longer Available but is now related. If I remove the focus (click somewhere else) it updates. There must be a fucntion for this. I have tried 'Refresh Window'.

Share this post


Link to post
Share on other sites

 A button can either be set up to make an immediate, single-step action.

Or it can be set up to call a script, which takes that action plus does some other things.

Set the button to call a script, which uses the set field action you're already performing, followed by:

Commit Record

Refresh Window [ flush cached join results]

Note that it may also help to put a Freeze Window statement as the first line of the script.

Share this post


Link to post
Share on other sites

Brilliant! Thanks for that.

It's been decades since I played with scripting in Filemaker and a lot has changed.

Share this post


Link to post
Share on other sites
10 hours ago, Wayne Irvine said:

I was doing a bunch of copy and pasting

Copy and paste is in the province of the users. You (the developer) shouldn't use it, unless the script is meant to assist the user in data entry.

 

10 hours ago, Wayne Irvine said:

If I remove the focus (click somewhere else) it updates.

Clicking on the background commits the record, and that's what your script needs to do too - sorry for not making that clear. I don't think you need to do anything beyond that, unless you run into refresh issues.

Share this post


Link to post
Share on other sites
17 minutes ago, comment said:

Copy and paste is in the province of the users. You (the developer) shouldn't use it, unless the script is meant to assist the user in data entry.

Hi Wayne, to explain a bit more ... not only does copy destroy a User's clipboard contents (usually needlessly, as Comment explains) but paste requires that the field being set exists on the current layout.  Down the road, you may remove that field and cause your script to fail, forgetting that it is dependent upon that field.  No such issues exist using Set Field[].

And welcome to FMForums!  :-)

Share this post


Link to post
Share on other sites

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

  • Similar Content

    • By Richard Fincher
      My production Filemaker Server 14 running on Mac OS X 10.11 El Capitan (Not Mac OS X Server) has been running fine for a year since I last installed the Thawte SSL Certificate.  After renewing the certifate this year, I've tried various different methods of importing the new certificate, which came with an intermediate certificate, but I can't seem to get the intermediate certificate installed.  I've been mostly using something like:
      sudo fmsadmin certificate import --keyfile /Users/richardfincher/Desktop/GBROOMX36-4X/private.key /Users/richardfincher//Desktop/GBROOMX36-4X/ssl_certificate.crt
       
      I've also tried importing it through the web control panel.  It was necessary to remove the old private key thus.:
      sudo rm /Library/FileMaker\ Server/CStore/serverKey.pem
      After it is (apparently) installed, I usually restart with :
      sudo fmsadmin restart adminserver
      although a few times I have rebooted the server (not a VM)
       
      Any thoughts welcome....
       
      Oh, one thing is, a year ago it might have been still on Mac OS X 10.8.5 Mountain Lion, which was the previous OS before I upgraded it.
    • By Chuck
      I know I've done this before, but can't find an example of the functionality in my archives and can't seem to work out how to do it again.
      I've got two tables: PERSONS and CONNECTIONS. PERSONS has an `id` field and CONNECTIONS has `person_1_id` and `person_2_id`. There's a relationship from PERSONS to CONNECTIONS with `id` = `person_1_id` and from CONNECTIONS to another TO  into PERSONS, connections_PERSONS, with `person_2_id` = `id`, but these relationships may need to change to make this work.
      On a layout with a context of PERSONS, I need a portal into CONNECTIONS that shows the names of the person on the other side of the relationship. So if Bill and Ted are connected, when viewing Bill's record I see Ted in the portal and when viewing Ted's record I see Bil's record.
    • By Qam Qam
      hello every one 
      there is a way to send SMS without any plugins , 
      there is a teacher named (guy setvens) who have course on udemy to explain it , problem is its paid , i i cant afford it 
      any one knows how to do it 
      please 
      i have bought 10000 SMS with api form sms provider 
      but i dont know how to use it without plugins 
       
    • By MSPJ
      So I have a hosted solution, with a dashboard with a couple portals. When I go to scroll a portal, scrolling even one portal screen has a delay of a few seconds, ie I click the scroll bar or try to drag it, and it takes about 3 seconds before it moves. Running locally, it's instantaneous. Running on a dev server on my LAN, there's a slight delay, but minimal.
      Having read various threads about this situation, my first thought was it's due to a filtered portal, so I removed filtering, but that made no difference.
      I also read various posts about unstored calcs and other factors that would cause all the data to have to be transferred to the client over the WAN.
      But here's the thing - at the moment, there are about 20 records in the database, related to the particular portal. 
      Clearly, moving that data can't be the primary issue - right? 
      I do have a lot of Execute SQL calculations in related tables, and I've read that can cause poor performance. But wouldn't that only be a factor when there are a lot of records?  
      Are there design /schema choices that would cause significant lag regardless of the amount of data? 
      Thanks,
      Michael
    • By Qam Qam
      Hello every one 
      i want to mention multiple filed in the email 
      like agent name 
      created by 
      and date of creation 
      to be sent to the manger 
      now i can only send one field  in the email 




  • Who Viewed the Topic

    2 members have viewed this topic:
    aztrix55  slinc 
×

Important Information

By using this site, you agree to our Terms of Use.