Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Numbering portal lines

Featured Replies

Ok. The invoice file. The portal line_item inside invoice file. How can I give a never-changeable ID for each item line, starting, of course, from 1 for each invoice?

Are you printing from the Invoices file or the Line Items file? If you're printing from the Invoices file, place a text block in the portal with "##" in it. This will give the row number for each portal.

If you're printing from the Line Items file or if you need the number to not necessarily be in order of line items (such as when you have three line items numbered 1, 2 and 3, you delete the one that is number 2 and you still want the last one to show up at 3) then you need to use a script to create the new line items and set the number at that time.

Chuck

Basically in the Invoices file you need a field called something like Next_LineItem_Number which defaults to 1. In the Line Items file you have a field called LineItem_Number. When your script creates a new related line item, you use the Set Field command to set the LineItem_Number to Next_LineItem_Number and then set Next_LineItem_Number to itself plus one.

Exactly what the steps are going to be depends on the existing new line items. Does your script create the related record from the parent database or from the child database? I tend to write my scripts so that they create new related records from within the parent database, so that's where I would need my two Set Field steps.

Chuck

  • Author

Ok, Mr. Chuck. Yes, I think with those hints I'll do it. It is for a database for tourism in Costa Rica. I feel very grateful.

Thanks again.

  • Author

Thank you, Chuck.

I'm printing from Invoices, but I need that each line keeps its own identity always, independently of the sort order or the like. That's why "@@" (or you really meant "##"?) doesn't work. The steps of the script that you mention is what I'm looking for.

Thank you.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.