Skip to Content
avatar image
Former Member

User Defined Field for Invoice Number Generation.

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

6 Answers

  • Mar 29, 2017 at 01:04 PM

    Hi,

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

    Regards,

    Nagarajan

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 28, 2017 at 01:57 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Mar 29, 2017 at 04:40 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 29, 2017 at 11:12 AM

    Hi Nabil,

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

    Regards:

    Balaji.S

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 29, 2017 at 11:53 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 29, 2017 at 11:55 AM

    Hi Nabil,

    Create a UDF with Numeric type

    Use the below Fms to fetch the Document number

    SELECT $[Ordr.Docnum]

    Regards:

    Balaji.S

    Add comment
    10|10000 characters needed characters exceeded