We have reset all users FileMaker related profile fields. Please take the opportunity to update your information,  this will provide background to members whom read your posts. Click here.

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
comment    1,357

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
BruceR    151

 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
comment    1,357
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
LaRetta    470
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 shencearn
      macOS Sierra Version 10.12.5
      trying to install FileMaker Server 14 with Web Server & PHP. I need web publishing enabled. I checked PHP and Yes, install the FileMaker server version of PHP.
      I get this error. Test web server (http://127.0.0.1:80/fmi-test/test.xml): Connection refused
      I have no idea where to start troubleshooting. I read through https://fmhelp.filemaker.com/docs/14/en/fms14_getting_started.pdf and nothing helped.
      Please help. Its appreciated.
    • By Rachel
      This is my first time posting, and I apologize if this is the wrong place. I've only been filemakering for a few months, so again, apologies if this is a stupid problem.
      I could use some advice.   I'm working on a solution that must create monthly reports in the following form:   http://i.imgur.com/Cf4Fjic.png   I've given up trying to bend the summary fields to my will, and began using the following approach:   Make two new tables - Queries and Reports.   In queries table, I have fields for M1, M2, M3, Region, Category, Subcategory and four result fields (M1, M2, M3 and YTD.) I also have foreign key into the reports table.   Then in reports table, I portal into the Queries table.   When report is run, a bunch of queries in queries table are created. The Results are populated via ExecuteSQL expressions.   My question is mainly this: Is this too backwards? I feel like maybe this is too weird of an approach and I"m just missing something simple about reporting and creating summaries?

      Thanks!  
    • By eljefejb
      I have installed FMS16 and FMPA16 locally on my Mac Pro (running El Cap) for testing purposes.  The admin console doesn't seem to be showing the correct information.  It is always listing connections that are no longer present, even after having restarted the server via command line, removing the file, etc.  After uploading a new file to the server, the new file doesn't appear in the admin console, but can be listed via command line.  Access also works by web direct, etc.
      Anyone else having issues with the admin console on FMS16?  What did you do about it?  My computer just got all the latest available system updates last Friday, so that shouldn't be the problem.
      Thanks!
    • By fileman922
      Hello
      we use filemaker server 15 and some macs takes long to upload an image in the container field, it takes about a minute to insert 100kb image.... when using filemaker server 14 it does not happend.... what could be the problem? 
    • By NewBoard
      I currently have a form that contains a portal. In the portal there is a value that will either be "Accepted" or "Rejected". I'm wondering if there's a way to parse through this table to check if any related values have a "Rejected" or if they are all "Accepted". Then using that outcome, decide if the form should display Rejected or Accepted.
      Please let me know if I need to provide any more information and/or images.
      Thanks in advance for any assistance you can offer!
×

Important Information

By using this site, you agree to our Guidelines.