Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

New portal record - is this possible?


This topic is 6656 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Superior knowledge requested!

My Portal allows creation of new records, and this works fine - enter data in fields on last portal row and the record is created in the related database upon commit.

However....

...can I 'shuffle' the order of these Portal records?

More specifically, all I want to do is click a button (in a row), which adds a blank record above (or below) the row with the button in it. Make sense?

I guess some kind of sorting might be the key. Currently records are NOT sorted in the Portal, which is fine (records appear in the order they are created).

Possible??

  • 2 weeks later...
Posted

Thanks for looking - although I think I've sussed it....

The portal is displaying related records within Events from a seperate Hires table (using a matching 'eventID' field). All the data (events, hires, stock etc....) are in a seperate file from my interface which contains the scripts, TOs and necessary relationships.

Adding 'categories' to each hire record, and sorting the portal via these categories works fine. It means that the line items (i.e. hire records) are in a logical order. A popup within the portal row allows the user to change the category to move the line item within the portal (scripted with pause for selection).

I even managed to add titles to each section in the portal by prefixing the uniqueID (generated when a new hire record is created in the hires table) with "1_" and adjusting the sort to sort by category and ascending hireID. This theory also worked for adding a new line item directly below a selected row - again scripted, but this time duplicating the hireID of the selected row and adding "A" so that it sorts as next in the portal. This all makes the resulting output much clearer, and allows for easy alterations to the original quote while maintaining the format.

If I've explained how I got it to work so you can understand it (!) some confirmation that this is sound practise would be appreciated!!

Thanks for taking the time to reply - I've been so busy, I hadn't seen your response to my original post.

Posted

Hi AliB,

The following will allow you to "bump" a record within a portal up or down by one row as well as insert a blank row at a specified point.

1. Create a field in the table that has your portal's data (Hires). Call it RowNumber (number) field and set it to auto-enter a serial number (so that when a new record is created it always goes to the "end" so-to-speak).

2. Go to the Hires table, choose Records > Show All Records from the "Records" drop-menu and sort the records as you desire (Unique ID, category, or . . . ). Place the cursor in the RowNumber field and choose Records > Replace Field Contents from the "Records" drop-menu. Choose "Replace with Serial Numbers", Initial value = 1, Increment = 1. Choose "Replace."

Then go to Define Database and set the next variable of the RowNumber field to be one greater than the count all of the records in that table so as to setup the next serial-RowNumber when new records are added later.

3. Go to the Events table and set the portal to sort the records by the RowNumber field rather than what you have now.

------------

TO BUMP A RECORD UP OR DOWN BY ONE ROW . . . place a button WITHIN THE PORTAL ROW to renumber that specific portal row's RowNumber field and then go to that portal row. See my example using arrows in the attached .jpg file.

Example, if the record's portal row is 11 and you want to move it to 10, go to related record, set RowNumber to 9.5, show all records, sort records by RowNumber, replace RowNumber with serial numbers, then go to the portal row.

Set Variable $portalrow = get (portalrownumber)

Goto related record

Show all records

set RowNumber (RowNumber -1.5)

Sort by RowNumber

Replace Field Contents (RowNumber, no dialog, serial = 1, increment = 1)

Goto Layout (original)

Goto portal row ($poralrownumber -1)

TO INSERT A BLANK ROW . . . say after the specified row . . . create a button to insert a row and then go to that portal row.

Example, if the record's portal row is 38 and you want to insert a blank row after 38 . . . . .

Set Variable $portalrownumber = get (portalrownumber)

Goto related record

Set Variable $rownumber = RowNumber

Show all records

New Record

set RowNumber ($rownumber + .5)

Sort by RowNumber

Replace Field Contents (RowNumber, no dialog, serial = 1, increment = 1)

Goto Layout (original)

Goto portal row ($poralrownumber + 1)

Now, do you see how the portal always sorts by the RowNumber field?

if you've got this down, you can ALSO create a button to sort ascending or descending by category, UID, etc. (one script for each), by

go to related record

Show All

sort (your preferences)

Replace Field Contents (RowNumber, no dialog, serial = 1, increment = 1)

Goto Layout (original)

FileMaker_Pro_Advanced002.jpg

Posted

Hi Jeff

Thank you for taking the trouble to write such an informative and detailed post. Completely understanding the principal, I am choosing to leave things as they are just now - having got the system up and running, I'm being constantly bombarded with requests for "tweaks" from my colleagues!!

Thanks again for your help.

This topic is 6656 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.