Gen Jnl Post-Batch CU changes doc no, =>< symbol

wilk_uwilk_u Member Posts: 94
Hello,
I'm doing some posting through gen jnl lines and mentioned codeunit, which has function called Code() and that piece of code in it:
IF NOT FIND('=><') THEN BEGIN
"Line No." := 0;
COMMIT;
EXIT;
END;

after that in debugger my document no. in my genJnlLine changes, i.e. from TEST/12/00001 to TEST/11/00199 (previous year no series and its last number) what causes error later on in posting, nav says, doc no. should be TEST/12/00001.
I totally can't figure out what is happening.
Can anybody help?

Thanks in advance

Comments

  • KYDutchieKYDutchie Member Posts: 345
    Hi,

    how did you filter the General Journal Line record before handing it of to Codeunit 13?
    If your filters on the record point to another Journal line then the journal line you are handing to CU13, you will get an error.

    For example:
    Journalline.GET('TemplateA', 'BatchA',10000);
    JournalLine.SETRANGE("Journal Batch Name",'BatchB');
    Codeunit.RUN(13,JournalLine);
    

    My advice is check your code just before you call codeunit 13. The problem probably exist in that area.

    Hope this helps,

    Regards,

    Willy
    Fostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    wilk_u wrote:
    IF NOT FIND('=><') THEN BEGIN

    This is a left over from the DOS days, and really is not needed now. It was used to optimize latency in hard drives. In SQL it has no performance difference.

    Take a look at the code, and see if you can replace it with FINDFIRST, FINDSET or FIND('-'). There may be a NEXT that you also need to change.
    David Singleton
Sign In or Register to comment.