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

Auto number portal rows?


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

Recommended Posts

Posted

How does one write a script to auto number a portal row as each new portal is created related to a record? I have an order database that has a portal for line items. I would like to give each line item it's own number. If I have to rely on people to enter the number it happens sporadically. I would like the user to still have the ability to enter the field and change it if they decided that one item should be ahead or before another.

Posted

you could add auto enter option and use the Get ( PortalRowNumber ) function - however, should you delete a portal row in the middle of your items, then the next number may be a duplicate.

If you were using FileMaker 10 you could add script triggers that could trigger when you exited a field or modified the record updating all the children records. - You could do so in v8 with a plugin but not as maintenance free.

If you don't need the row number in the actual child table and this is just to be used to show for display row number just add @@ in the portal so that each row has a number.

Posted

Set up a self join relationship between the LINE_ITEMS table using the OrderID field as the key, this will group together all the LINE_ITEMS that belong to a specific ORDER:

LINE_ITEMS.SelfJoin = LINE_ITEMS.OrderID::LINE_ITEMS.OrderID

Use the new relationship with the MAX function in an AutoEnter field (say, LineNumber)

So.

LineNumber =

Max (LINE_ITEMS.SelfJoin) + 1

This will always increment the LineNumber and won't be duplicated and the users can still modify the LineNumber.

I did such a thing so a user could manually change the sort order for the LINE_ITEMS, thus printing the ORDER in their preferred sequence.

  • 2 years later...
Posted (edited)

Hello,

I found this post and am trying to figure this out.

Edited by Lee Smith
Remove the quote of IdealData above.
Posted

Then why quote the entire post? The "notes" were in the quote and appeared to be part of it. You should have asked your question below the part of the post you wanted to quote that you were referring to. You do not need to quote the whole body when referring to another post. Just delete those part that are not pertinent your question.

Try asking your question again without quoting the whole thing.

  • 5 months later...

This topic is 4230 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.