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.

Featured Replies

Hi all,

 

I have a manual input field, and I plan to replace it to calculation field instead.

 

The field is show as below:

 

Invoice-136-036-15

136 being the category

036 being the last record

15 being the year invoice was created.

 

Is there a way to obtain the "036" and replace the XXX to display as Invoice-136-037-15 once a new record is created?

"Invoice-136-"  &  "XXX" & "-" & Right(Year ( Get ( CurrentDate ) );2)

 

Appreciate your advices.

  • Author

in addition, the record number will reset at the beginning of a new year.

Invoice-136-001-16 when it's 2016

I would suggest you start with a simple Number field, set to auto-enter a serial number. Then add a calculation field along the lines of =

"Invoice-" & Category  & SerialIncrement ( "-000" ; SerialNumber ) & "-" & Right ( Year ( InvoiceDate ) ; 2 )

See a recent discussion about resetting a serial number at the beginning of a year:

http://fmforums.com/forum/topic/94445-new-serial-start-of-year/?p=431915

 

Important:

Make sure you have another field, InvoiceID, that auto-enters a serial number consecutively and will never be changed by anything the user does. Use only this field as the matchfield for your relationships.

  • Author

Hi Comment,

 

Thanks for the reply. 

It makes more sense to use Year (InvoiceDate) than Year (Get (CurrentDate) )

 

However, SerialIncrement does not seem to work very well with my string.

I will like the field to display the Serialnumber as a fixed 3-digit code

 

Was trying to

Case ( 
Length ( SerialNumber ) = 1 ; "00" & SerialNumber  ; 
Length ( SerialNumber ) = 2 ; "0" & SerialNumber  ; 
)
but was unsuccessful in integrating it.
SerialIncrement does not seem to work very well with my string.

 

Could you provide a more accurate description of the problem than just "does not seem to work very well"? Something along the lines of "I have an input of x as the SerialNumber, and I am getting the result of y, instead of the expected z" would be much more productive.

  • Author

Hi Comment,

 

Sorry about it.

 

Was trying to get the result

"Invoice-136-036-15" using "Invoice-" & Category & "-" & SerialIncrement ("000"; SerialNumber) & "-" & Right ( Year (InvoiceDate); 2 ), instead, I'm getting "Invoice-136-36-15"

I intend to stick my string of serialnumber to a 3-digit code here.

I'm getting "Invoice-136-36-15"

 

I am not:

 

post-72594-0-96995700-1425344962.png

post-72594-0-96995700-1425344962_thumb.p

  • Author

Hi Comment,

 

I have no idea why, it's showing the correct values today.

My apologies.

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.