Dataport to Ship and Invoice Sales Order

owiccrossettowiccrossett Member Posts: 13
edited 2007-05-14 in Navision Attain
Hi,

We are attempting to start having our sales order posted and invoiced when the order leaves the building instead of having customer service go in every day and Ship and Invoice every order.

We have created an external database that will read the sales order number and then with a handheld devise we are able to read the barcode of each item on the order and then we will print off what actually shipped.

So I would like to build a dataport that will update the the quantity shipped and qty. to ship and then run the codeunit 83 (I think that is the one that will ship and invoice an order) and have it print off the invoice and do all of the accounting entries and update everything. I feel confident that I can builde a dataport to overwrite the Outstanding Quantity and Qty to Ship fields but how can I get it to actually ship and invoice the order automatically and also print the invoice?

Thanks in advance

:)

Comments

  • nunomaianunomaia Member Posts: 1,153
    You don’t need to fill “Outstanding Quantity” you only need to fill Qtd. To Ship.

    Next you have to make a copy of codeunit 5765 - Whse.-Post Shipment + Print. To post shipment without confirm to user and invoice.
    Nuno Maia

    Freelance Dynamics AX
    Blog : http://axnmaia.wordpress.com/
  • krikikriki Member, Moderator Posts: 9,112
    The dataport :
    You need only to overwrite "Qty. To Ship". But remember to use a VALIDATE on the field, because this validate has to do other things too.

    The data you import from a textfile is best limited to 1 sales order per file.
    This because when you post a sales order, at the end there is a COMMIT.
    So if you post multiple sales orders and in one of them, you have an error, the others will have been posted and COMMITED, but not all. And in this case you will need to track what has been posted and what not.

    So:best 1 sales order per textfile!
    In the OnPostDataport-trigger, you can post (=ship+invoice) your sales order.
    Of course, you need to have saved the number of the sales order in some variable.
    This is the code for posting (=ship+invoice) a sales order in the OnPostDataport-trigger:
    recSalesHeader.GET(recSalesHeader."Document Type"::Order,codSalesOrder);
    
    recSalesHeader.Ship := TRUE;
    recSalesHeader.Invoice := TRUE;
    recSalesHeader.Receive := FALSE;
    CODEUNIT.RUN(CODEUNIT::"Sales-Post",recSalesHeader);
    
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • owiccrossettowiccrossett Member Posts: 13
    Thank you so much. That is exactly what I was looking for. I am sure it will work great.

    Thanks again

    :D
Sign In or Register to comment.