Transaction id, state

rixrixrixrix Member Posts: 121
Hello

Is it possible in NAV to get ID of the transaction (as on MSSQL server)
Or even better to get state of transaction (Active, Error, ...)

Thank you

Comments

  • krikikriki Member, Moderator Posts: 9,110
    No, it is not possible.

    You can use some NAV functionality for launching a codeunit:
    IF something throws an error in the called codeunit, this code intercepts it.
    CLEARLASTERROR;
    IF NOT CODEUNIT.RUN(CODEUNIT::"Some codeunit") THEN BEGIN
      MESSAGE('Error:%1',GETLASTERRORTEXT);
    END;
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • rixrixrixrix Member Posts: 121
    And is there some way to get info if transaction ended with error or was successful?

    Simple example (not in NAV syntax)

    I will have on push event:

    1. xxx,xxx,xxx (as transaction)
    2. Display msg 'A'

    If "1." is successful, then "A" will be displayed, but when "1." will end with error, nothing after it will be executed.
    But I want "B" to be displayed in all cases. How to do it?

    thx
  • rhpntrhpnt Member Posts: 688
    Dear rixrix,

    you should REALLY read the Application Designers Guide for NAV included on every NAV installation CD.
  • kinekine Member Posts: 12,562
    rixrix wrote:
    And is there some way to get info if transaction ended with error or was successful?

    Simple example (not in NAV syntax)

    I will have on push event:

    1. xxx,xxx,xxx (as transaction)
    2. Display msg 'A'

    If "1." is successful, then "A" will be displayed, but when "1." will end with error, nothing after it will be executed.
    But I want "B" to be displayed in all cases. How to do it?

    thx

    1) What you really need to do?
    2) You can search on this forum for more. There are more threads about "Catching errors"
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.