skearton Posted December 28, 2009 Share Posted December 28, 2009 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. Link to comment Share on other sites More sharing options...
Ocean West Posted December 28, 2009 Share Posted December 28, 2009 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. Link to comment Share on other sites More sharing options...
IdealData Posted December 28, 2009 Share Posted December 28, 2009 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. Link to comment Share on other sites More sharing options...
Reid Posted November 6, 2012 Share Posted November 6, 2012 (edited) Hello, I found this post and am trying to figure this out. Edited November 6, 2012 by Lee Smith Remove the quote of IdealData above. Link to comment Share on other sites More sharing options...
Lee Smith Posted November 6, 2012 Share Posted November 6, 2012 Instead of quoting an entire post, explain what you do not understand. Link to comment Share on other sites More sharing options...
Reid Posted November 6, 2012 Share Posted November 6, 2012 My notes were in Red in the quoted part. Link to comment Share on other sites More sharing options...
Lee Smith Posted November 6, 2012 Share Posted November 6, 2012 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. Link to comment Share on other sites More sharing options...
Newbies filemaker1 Posted April 25, 2013 Newbies Share Posted April 25, 2013 {{RecordNumber}} Alex .S. Filemaker Developer Toronto Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 4037 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 accountSign in
Already have an account? Sign in here.
Sign In Now