AnsweredAssumed Answered

Increment Number by 1

Question asked by mengzi888 on Jul 31, 2016
Latest reply on Jul 31, 2016 by philmodjunk

Hi,

 

I have the following problem with my invouce app.

 

 

This is the scenario

Table

Invoice

Fields

Text-Field Invoice-Number

Datefield Invoice_Date

 

Invoice_Date is filled with the current date

Get (CurrentDate)

 

Invoice_Number should be filled with the text

"Invoice[space][current year]-[space]"

then there should be a number added with the following requirements

1. If a new year begins, the first in voice in that year should start with "1"

2. During the current year, the number should increase by 1 with every new invoice

 

I was using the following solution which did not work properly

 

"Invoice"

& " "

& Year ( Get ( CurrentDate ) )

& "- "

& If ( Year ( Get (CurrentDate)) > Year ( Max (Invoice_Date)); "1"; SerialIncrement ( Invoice_Number; 1 ))

 

Unfortunately this does not work.

Any ideas ?

 

Thanks

Outcomes