Skip to Content
1

User Defined Field for Invoice Number Generation.

Mar 28, 2017 at 12:21 PM

62

avatar image
Former Member

Hi All ,

I need to create a user defined field in OINV which will automatically generate Invoice No. Just like 'oinv.docnum' field.How can i do this ? Also we need to reset the value of this field every year.This field will be used as Invoice no. instead of oinv.docnum field.Every financial year we need to reset the value to zero and start again.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Nagarajan K Mar 29, 2017 at 01:04 PM
1

Hi,

Better use standard document numbering for every year instead of UDF.

Regards,

Nagarajan

Share
10 |10000 characters needed characters left characters exceeded
Balaji Selvaraj Mar 28, 2017 at 01:57 PM
0

Hi Nabil Rashid,

Are you going to have same number as in Document Number or you going to have different number in the UDF.

Regards:

Balaji.S

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Mar 29, 2017 at 04:40 AM
0

Balaji ,

I need continuous numbers for Invoice .It should start like 1,2,3 etc.Also need to rest the value of this udf when the financial period ends.

Share
10 |10000 characters needed characters left characters exceeded
Balaji Selvaraj Mar 29, 2017 at 11:12 AM
0

Hi Nabil,

Then use FMS to fetch the invoice number and display at the UDF field where you required.

Regards:

Balaji.S

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member
0

Balaji ,

Can you please share me the same in step by step ?

0
Johan Hakkesteegt Mar 29, 2017 at 11:53 AM
0

Hi,

Interesting question. Please try this:

SELECT DISTINCT CASE
                 WHEN YEAR((select DocDate 
                            from OINV 
                            where DocNum = (select max(DocNum) 
                                            from OINV))) = YEAR(GETDATE()) THEN MAX(U_YourUDF) + 1
                 ELSE 1
                END
FROM OINV
WHERE YEAR(DocDate) = YEAR(GETDATE())

Please note that you can really only test this on the morning of 1st of January 2018, unless you have a separate test system which date you can set manually.

Regards,

Johan

Share
10 |10000 characters needed characters left characters exceeded
Balaji Selvaraj Mar 29, 2017 at 11:55 AM
0

Hi Nabil,

Create a UDF with Numeric type

Use the below Fms to fetch the Document number

SELECT $[Ordr.Docnum]

Regards:

Balaji.S

Share
10 |10000 characters needed characters left characters exceeded