Designing Posting Routine - getting error

RoddyMcLeanRoddyMcLean Member Posts: 101
Hi,

I have written a posting routine which serves a couple of purposes and for one it is working well. For the other I am getting an error :-
The Ledger Entry Dimension already exists.
Identification fields and values
Table ID = '25', Entry No. = '1475', Dimension Code = 'ACTIVITY'

The debugger traps this error on a COMMIT statement after my posting routines have been executed: -
   PostingRoutines are here

    COMMIT;  //the debugger stops here
    CLEAR(GenJnlPostLine);
    IF PostToGL THEN BEGIN
      UpdateAnalysisView.UpdateAll(0,TRUE);
      COMMIT;
    END;

If I remove the COMMITs then the debugger traps nothing, executes the remaining lines and I get the same error message as above when control is passed back to the NAV client.

Thanks in anticipation...

Comments

  • kapamaroukapamarou Member Posts: 1,152
    You are trying to insert a record with a duplicate primary key.

    Review your code.
    Read this post to see if it applies to your case....

    viewtopic.php?f=23&t=30134&hilit=delayed+commit
  • RoddyMcLeanRoddyMcLean Member Posts: 101
    Thanks all is working well. I had mistyped: -
      GenJnlPostLine.RunWithCheck(GenJnlLine, JnlLineDim);
    
    Should have been: -
    
      GenJnlPostLine.RunWithCheck(GenJnlLine, TempJnlLineDim);
    

    This really got me though ](*,) . I was not aware of the behaviour.

    Thanks Again!
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.