SalesLine with LineNo = 0

galmokgalmok Member Posts: 44
I created (by accident/dataimport) a SalesLine with the line number 0. This is not what I wanted and there I tried correcting the error.

I tried deleting the sales line in the Sales Order UI. Result: Navision crash.

I tried deleting the sales line in the Object Designer->Table->ID:37->Run, find the line and delete it. Result: Navision crash.

I tried changing the line no in the object designer: Result: "Do you want to rename the record?". Tried both yes and no. Yes: Cannot rename, No: Nothing done.

I am not sure how I can fix this problem. Suggestions? Do I need someone with a developer license to hack that sales line to have a line number different from 0?

At any rate, I don't feel Navision shouldn't crash due to such an error.

Comments

  • ara3nara3n Member Posts: 9,255
    the reason it crashes is because it runs into infinite loop.

    There is code the on delete that tries to delete related sales line no. When line no is 0, it relates to it self.

    Two ways to fix. Commend out the code temporary or change it to only run if line no is not 0.

    Or write a report to delete that sales line without delete(true);

    If you are on sql you can delete it from sql as well.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • galmokgalmok Member Posts: 44
    Thank you for the help.

    I used the suggestion of a dataport with DELETE(FALSE). I completely forgot that I could prevent the update trigger from triggering. :oops:
  • ara3nara3n Member Posts: 9,255
    You are welcome. It happens to all of us.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.