Hi, For the No. Series of the Sales Invoice No., it has two relationships. The first relationship is going to have the current month prefix shows before the Sales Invoice No.; it is called ‘LF’. The format will be like this: MMNNNN. The second relationship is going to have the current month suffix shows after the Sales Invoice No.; it is called ‘TC’. The format will be like this: SI-NNNN-MM. I have the following codes on the OnInsert trigger of the Sales Header table (after the initseries function is called): IF (“Document Type” = “Document Type”::Invoice) THEN IF Rec.“No. Series” = ‘LF’ THEN IF Month <10 THEN “No.” := “No.” + ‘-’ + FORMAT(Zero) + FORMAT(Month) ELSE “No.” := “No.” + ‘-’ + FORMAT(Month); IF Rec.“No. Series” = ‘TC’ THEN “No.” := FORMAT(Month) + “No.”; It will work as long as I use either one of the relationship. The problem is after I switch from one relationship to the other one, it will get me the Sales Invoice No., but the month prefix or suffix will not show up. The strange thing is when I created another Sales Invoice, the prefix or suffix will show up again. My coworker suggested me to add an option field in the No. Series Line table called “Order of Month” with 2 options: prefix and suffix. He said that so I don’t have to hard code my new code. Say, later on, the client is running out of numbers from the two relationships of the No. Series, and I will not have to modify the codes again. It sounds like a good way to deal with my situation. But, how do I go by doing it? Will I have to modify some codes in the Codeunit 396? Thanks in advance. Sincerely, Sylvia Tsang Management Software Solutions, Inc. stsang@mgmtsoftware.com
I am really not sure where you are going with this question! Could you put more info. / detail in this and I will try again. Steve Florko NCPS,NCSD,NCDS,WSSD,WSWD Application Development