Solved

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

Posted on 2011-03-13
5
827 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
Comment Utility
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 24

Accepted Solution

by:
Will Loving earned 300 total points
Comment Utility
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
Comment Utility
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 24

Expert Comment

by:Will Loving
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
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…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

8 Experts available now in Live!

Get 1:1 Help Now