cancel
Showing results for 
Search instead for 
Did you mean: 

User Defined Field for Invoice Number Generation.

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.

Accepted Solutions (0)

Answers (6)

Answers (6)

kothandaraman_nagarajan
Active Contributor

Hi,

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

Regards,

Nagarajan

former_member312729
Active Contributor
0 Kudos

Hi Nabil,

Create a UDF with Numeric type

Use the below Fms to fetch the Document number

SELECT $[Ordr.Docnum]

Regards:

Balaji.S

Johan_H
Active Contributor
0 Kudos

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

former_member312729
Active Contributor
0 Kudos

Hi Nabil,

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

Regards:

Balaji.S

Former Member
0 Kudos
0

Balaji ,

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

Former Member
0 Kudos

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.

former_member312729
Active Contributor
0 Kudos

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