• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1269
  • Last Modified:

FM - New Portal Row at the Top?

Searched EE knowledebase and found nothing.  Before I bang away a this, anyone know how to put the new portal row so it shows at the top?  Specifically, I have a separate Notes table and have brought it in via a portal.  Sometimes we can have enough notes to drop the new row below the bottom of the portal display.  I supposed I could have a button that takes them to the blank field, but any way to sort it to the top?
0
rvfowler2
Asked:
rvfowler2
  • 6
  • 6
5 Solutions
 
North2AlaskaCommented:
To insure that it is alway at the top, you have to do a little juggling.  You can simply turn on sorting for the portal ( I usually capture the date it was created and then sort it ascending) but when you create the row using the "Create related records option, it seems always to be at the bottom.  So, here is what I do.  I have a script that creates the related row, saves it and then lets the sort order place it where it needs to be.  Finally, set the current row to the newly created one.
0
 
Will LovingPresidentCommented:
FileMaker does not include a setting that allows for this but you can force it by creating a "New" button and script and by having your portal sorted in Descending order by either the Record ID for the Notes record or by Creation Date and Time.

You script should include the following steps (and I'll just note that there are ways to make this more compact with additional structure, but this is a simple, direct method):

Set Variable [$Customer ID ; Customers::CustomerID]
Go to Layout [ some layout based on the Notes table ]
New Record
Set Field [ Notes::CustomerID ; $CustomerID ]
Commit Records/Requests [Skip Validation ; No Dialog]
Go to Layout [Original Layout]
Refresh Window
Go to field [ Notes::NoteText ]

This works ONLY if your portal or portal relationship is set to sort Descending by Creation Date/Time (or TimeStamp, or Notes RecordID/Serial Number). The Refresh is generally necessary to force the new record to appear in the correct sort order and for the last step you can either use Go To Field or Go To Object if the field is a named object.

If you use this setup you should turn OFF the "Allow creation of new records.." option in the Customer to Notes relationship to force users to just use the "New" button. If you want to get fancy you can add the Customer ID of the current record as a script parameter to the "New" Button, then instead of creating  the variable, you just use Get ( ScriptParameter ) on the Notes layout.

0
 
rvfowler2Author Commented:
First, I do sort by descending order so the latest is always on top.  Second, I have a couple of variables I need to pass:  sales agent ID, data entry ID, and recID for the foreign key.  Currently this happens with autoentry fields.  What about the best of both worlds?  Could I just have the New button take me to the bottom and add a space, then commit the record (I tested it; it then shows up at the top), then Go to Field [Notes::NotesText], which is set to highlight the entire field, then delete the space?  I could even freeze the window and unfreeze it so the user does not see what is happening until it is over.  Or... in your experience, would having a row and a button to create a new field just confuse the user?
-NotesNew.JPG
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
Will LovingPresidentCommented:
Yes, you sort by descending order to the newest is on the top. The technique you are describing of adding a space, Committing the record and then using Go to Field should also work. Freeze window can also help reduce 'flashing' for  the end user. You may or may not need a Refresh Window.

I do think that you should not have both a "New" button and the open row at the bottom as well as it can be confusing. Consistent interface is always helpful. Turn off the "Allow Creation of New Records..." in the relationship to get rid of the row.
0
 
Will LovingPresidentCommented:
I would also put the new button at the top of the portal since having it within the portal at the bottom means that if you have more notes than you have portal rows it won't be visible. A simple green "Plus" with a Tooltip that say "Click here to create a new NOte" will usually do.

With regard to the additional variables, you can either pass them to the script as a carriage return separated set of script parameters and then use GetValue( Get ( ScriptParameter ) ; 1 )  to enter them in the Notes record (using my previous script example).

Another way to gain some space is to change your Y/N radio button to a Y checkbox.
0
 
rvfowler2Author Commented:
So, you mean that you can use GetValue ( Get ( ScriptParameter ) ; 1 ) to get the first parameter when it is delineated by a carriage return and then GetValue( Get ( ScriptParameter ) ; 2) for the second one?  So below, 1 above would return LC and 2 above would return GM?  If so, very cool; didn't know that.  

LC
GM
0
 
rvfowler2Author Commented:
Also, dumb question.  How do you get a plus sign to show up without taking up so much space as happens when you use text (the vertical borders are so high).  Do you just paste it into a jpg file and insert it as a picture?
0
 
Will LovingPresidentCommented:
Correct on the usage of GetValue() and I'll give you an even more clever version later that uses a Custom Function to allow you to name variables and put them in any order you want.

Use a graphic image. I'll post an images file with some nice pngs you can use.
0
 
rvfowler2Author Commented:
OK.  I tried Photoshop, but kept getting a white backgound, so used two 3pt lines as a + sign for now.  New at this symbol business.
0
 
Will LovingPresidentCommented:
This file contains a large number of open source icons. The source is listed for each icon. If you use the icon in a distributed product, commercial or otherwise, you need to credit the author and include the Open Source license agreement which can be found on the web with the icon library.
Icons.fp7.zip
0
 
Will LovingPresidentCommented:
Using FileMaker drawing elements is a good way to create simple graphics. It has the advantage of displaying faster than a JPEG or PNG image, though with something that small it won't make much of a difference. if you are using a background that is different that the background of the graphic, you may wish to either put the graphic on top of a rectangle or oval to give it a button appearance, or edit the graphic in Photoshop or some other program to make the background transparent. Note that JPEGs can't have transparent backgrounds, so use PNG or GIF format.
0
 
rvfowler2Author Commented:
Turns out that I didn't need the elegant way you passed through multiple parameters.  I just passed through the one RecID for a foreign key and made all the others auto-enter and it worked.  Second, seems the refresh window causes a slight delay in the script so took it out, and I gave the Notes field a Ojbect name of NotesEntry and used the GotoObject, which defaulted to the first row (so didn't need a GotoPortalrow before this).  And, Will, did use your plus icon.  Thanks.  Thanks to all.
0
 
rvfowler2Author Commented:
Thanks, and Will, even though I didn't use the multiple parameters pass through solution this time, definitely will in the future.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now