Rollback Transaction

mkpjsrmkpjsr Member Posts: 587
Hi all,
I want to know that how can we rollback transaction in navision. As we see while posting any document in navision if any error occur then the whole transaction is rollbacked.

suppose I have a custom field on purchase invoice that should meet certain criteria before posting. if someone tries to post the invoice without meeting the criteria (say the field should have a value less than 50) of the custom field then it should give an error and the document should not be posted.

how can we do this..

Comments

  • lvanvugtlvanvugt Member Posts: 774
    Without knowing your exact setup I say: use TESTFIELD, ERROR or FIELDERROR function (posible combined with and IF statement).
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • bbrownbbrown Member Posts: 3,268
    If you have required values, test for them at the beginning of you posting process. Before any data changes have been made. This way if an error is found nothing has changed yet. So there is nothing to rollback.
    There are no bugs - only undocumented features.
  • mkpjsrmkpjsr Member Posts: 587
    bbrown wrote:
    If you have required values, test for them at the beginning of you posting process. Before any data changes have been made. This way if an error is found nothing has changed yet. So there is nothing to rollback.

    Thanx for the reply,

    Suppose On Sales Order I want that if The "Qty. To Ship" is greater than 100 then its should give an error, so where should I call the TESTFIELD function.
  • bbrownbbrown Member Posts: 3,268
    Early in CU 80. Before any data modification (insert,modify,delete) statements are executed.
    There are no bugs - only undocumented features.
  • StLiStLi Member Posts: 83
    mkpjsr wrote:
    bbrown wrote:
    If you have required values, test for them at the beginning of you posting process. Before any data changes have been made. This way if an error is found nothing has changed yet. So there is nothing to rollback.

    Thanx for the reply,

    Suppose On Sales Order I want that if The "Qty. To Ship" is greater than 100 then its should give an error, so where should I call the TESTFIELD function.

    if "Qty. To Ship" > 100 then
    ERROR('"Qty. To Ship" is greater than 100');

    TESTFIELD always checks for an exact match.
Sign In or Register to comment.