Solved

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

Posted on 2011-03-13
5
830 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

816 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now