Problem in the Sales Header

suresh111suresh111 Member Posts: 32
edited 2006-06-13 in Navision Attain
Hi

we have created a sales order, made some shipments from the sales order.

But one of the user deleted the Sell-to-Customer code from the header after the shipment is made.Is it possible? when i try the same thing in a dummy database, the system did not allow me to change or delete the sell-to customer code. but it happened. when i try to rectify the error by applying the Sell-to customer code again the system gives an error division by zero. since customer code is deleted from the header, the currency code and all the relevant information from the customer card is also erased. it checks the currency exchange rate table when i try to apply the Sell-to customer code. How to put the same customer code in the sales header.

Can any one explain me situation when can such type of errors happen?

regards,Suresh

Comments

  • David_CoxDavid_Cox Member Posts: 509
    Have you changed any Code in the Posting codeunits ?
    Or have you dataported back bad data into the sales header table ?
    These are the only way this can happen.

    The way to get the Sell-to Customer No. back in the header, create a blank report with No table , go to the properties and set it to processing only.

    Variable 1 SalesHeader
    Variable 2 Customer

    Go to the code section

    Report - OnPreReport()
    Customer.GET(CUSTOMERNO);
    SalesHeader.GET(1,SALESDOCNO);
    SalesHeader."Sell-to Customer No." := Customer."No.";
    SalesHeader."Sell-to Customer Name" := Customer."Name;
    ~
    any other values add the same way
    Then modify without validation
    ~
    SalesHeader.MODIFY;

    That's it, then find the bad code! [-X
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
Sign In or Register to comment.