Solved

FM - Creating a New Portal Row Via a Script, Part II

Posted on 2011-03-13
5
836 Views
Last Modified: 2012-05-11
Searched EE and found nothing specifically on this.  I learned how to create a portal row when I had allowed the creation with the Relationship.  However, this time, my customers did not want to have an empty row (a portal row is only added once per year).  Is there any way to create a portal record other than navigating to the related layout and coming back (I've already done that just now)?  In FM''s script steps, I've noticed that there is a delete portal row step, but no create portal row, which would be nice.  Thanks.

0
Comment
Question by:rvfowler2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 12

Expert Comment

by:North2Alaska
ID: 35127920
As far as I know, there is no create portal row method other than scripting a goto layout, set the key and back to layout.  (At least that is the way I've always done it...)
0
 
LVL 25

Accepted Solution

by:
Will Loving earned 300 total points
ID: 35128354
N2A is correct as far as I know. You have to capture the key (ContactID, etc.) using Set Variable, go to a layout based on the table that you want to create the record in, create the record, set the key field using the variable, and then return back to the original layout, often with a "Refresh Window" step.

Set Variable [ $ContactID ; Value: <theContactID> ]
Go to Layout [ Notes ]
Create Record
Set Field [ ContactID ; $ContactID ]
Go to Layout [ original layout ]
Refresh Window [ ]

However, my preferred method here is to use one of my master scripts called "Open new window OFF-Screen", which opens a new window using Height and Length = 0 and position -200 top and -200 left. The name of the window can be generic but I use an optional script parameter to set the name of the window based on what it's doing for trouble-shooting purposes. Some people go further and set a second script parameter that includes the layout name but because layout names can change I prefer not to do that.


Set Variable [ $ContactID ; Value: <theContactID> ]
Perform Script [ Open Window OFF-screen ; Parameter: "Add Note record" ]
Go to Layout [ Notes ]
Create Record
Set Field [ ContactID ; $ContactID ]
Close Window
Refresh Window [ ]

If your portal is sorted by something other than creation date descending, so the most recent record is always on top, you can get your new record to sort to the top by doing the following:

1. Create a calc field in the related table that checks to see if a field the user would ALWAYS fill in is filled and if so set that calc result to 1.

2. Set your sort order for the relationship from the primary table to the child table to include that calc field as the first sort value. That way, if the field is empty, that record will always sort to the top. The Refresh Window [] step is essential to getting the portal to sort properly if you use this method and sometimes a Commit Record step as well.
0
 
LVL 12

Assisted Solution

by:North2Alaska
North2Alaska earned 200 total points
ID: 35128521
I stand corrected.  I did a little research and found a example of creating a related record without having to go to the layout.  I found the reference in this Thread.  There is a comment made by Bruce Robertson close to the end of the thread that points to an example at Download Example

It is a very clever method that uses global fields and multiple relationships (some with the Allow creation of records checked but not displayed.)  Very nice and I have a couple of places I can use this method.

Time to go to work and implement this idea...  :-)
0
 
LVL 25

Expert Comment

by:Will Loving
ID: 35128598
I recall now seeing this method many years ago but it was not nearly so well-delineated. The only (minor) downside is the proliferation of relationships solely for creating records. Thanks for posting the link.
0
 
LVL 2

Author Closing Comment

by:rvfowler2
ID: 35129626
Thanks.  For me personally, I prefer to not create all the extra relationships, etc., just to avoid going to a layout.  Was hoping for something simple.  Following is how I did it and it works fine.  It is also so fast that you don't even see it going to the next layout.  However, thanks for all the research and info.  Valuable.  Will, I'm going to have to research this master script idea that you keep talking about.  Know nothing about that.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
Problem: You have a hosted FileMaker database and users are tired of having to use Open Remote or Open Recent to access the database. They say, "can't you just give us something to double-click on rather than have to go through those dialogs?" An…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question