update SalesHeaderTable onpush

Prototype1Prototype1 Member Posts: 37
I have an additional Status field on my SalesHeader which appears on my Quotations. It has an Option string of "New & Order". I am trying to change the value of this field from "New" to "Order" when I convert the Quotation to an Order. (I want to filter on this field to list outstanding Quotations). I tried to add code to Codeunit 86 Sales-Quote to Order, which is called from a command button, but I cannot get the Sales Header table to Update. Any suggestions welcome.

Thanks

Tim

Comments

  • DenSterDenSter Member Posts: 8,304
    So all of your quotes have the status field set to "New", and all of your orders have their status field set to "Order"?
  • garakgarak Member Posts: 3,263
    before the SalesOrderHeader.MODIFY; in CU you can do this.
    But why do you need this field? The order you can identify by the field document type.
    Or became all new Orders, they are not from a quote also the status "New"?
    I doesn't see there a reason ....
    Do you make it right, it works too!
  • Prototype1Prototype1 Member Posts: 37
    We have adapted NAV to keep the Quote when creating an Order. I currently cannot tell which Quotes have not been "won". We have the added the additional status field on our Quotes to show this but it is currently manually changed and I want it automated.

    Thanks

    Tim
  • ritesh.singhritesh.singh Member Posts: 123
    Prototype1 wrote:
    We have adapted NAV to keep the Quote when creating an Order. I currently cannot tell which Quotes have not been "won". We have the added the additional status field on our Quotes to show this but it is currently manually changed and I want it automated.

    When the quote is convereted to order the quote is deleted and the quote no. flows to the sales order. All the quotes you can see have not "won".

    Still if you want to manage you can modify the sales header - quote at CU 86 before "Delete" (Which you might have commented for your purpose).
    Thanks,
    Ritesh K Singh
  • Prototype1Prototype1 Member Posts: 37
    Thanks for the reply. Our system leaves the Quote intact and, I assume, takes a copy of it to produce the Order. This is why I want this additional status field to show that an Order has been produced based on the Quote. You are correct that the "Delete" parts are commented out in CU 86. Bit out of my depth here.I can't see where in CU 86 to add the new code.

    Any pointers greatfully received.
    Thanks
  • meikcremermeikcremer Member Posts: 7
    We work in a similar way. So at the end right between your commented DELETE and the COMMIT:

    DELETE;
    SalesQuoteLine.DELETEALL;
    FromDocDim.SETRANGE("Line No.");
    FromDocDim.DELETEALL;

    YourOrderStatus := YourOrderStatus::Order;
    MODIFY;


    COMMIT;
    CLEAR(CustCheckCreditLimit);
    CLEAR(ItemCheckAvail);
  • Prototype1Prototype1 Member Posts: 37
    Perfect. =D>

    Thank you very much.
Sign In or Register to comment.