No. series problem

Journal vouchers were created in a codeunit using No. series mgmt. routine using function TryGetNextNo(jnlBatch.“No. Series”,TODAY). But the no. is not incremented for the subsequent vouchers . If I use GetNextNo function with boolean set to TRUE, the no. is incremented but posting fails. Actually, the no. shd be increased in no. series line table only after posting is thru successfully. How to resolve this ?

Hi, Try this function InitSeries(DefaultNoSeriesCode : Code[10];OldNoSeriesCode : Code[10];NewDate : Date;VAR NewNo : Code[20];VAR NewNoSeriesCode : Code[10] Bye

Hi I think you should check if Journal vouchers already has some record or not. If HAS Then “No.” := INCSTR(“No.”) ELSE “No.” := TryGetNextNo(jnlBatch.“No. Series”,TODAY) Hope this will help you :slight_smile: