How to create a Sales Order Programmatically?

slmaluwaslmaluwa Member Posts: 366
Hi

We are planning to create sales orders through coding.
Can you please guide us the proper way to do it?
A summarised step by step explanation will help a lot.

Thank you

Maluwa
"A bove maiore discit arare minor"-"From the old ox, the young one learns to plow."

Comments

  • ssinglassingla Member Posts: 2,973
    We are planning to create sales orders through coding.

    How the system will know which customer and what item will be booked in the sales order :-k :-k .
    Are you looking for a single screen sales order which will reduce the effort of user :?:
    CA Sandeep Singla
    http://ssdynamics.co.in
  • slmaluwaslmaluwa Member Posts: 366
    Sorry for the confusion.

    We already know the customer and items to include in the order lines
    We are using NAV 4 SP3

    Thank you
    "A bove maiore discit arare minor"-"From the old ox, the young one learns to plow."
  • SavatageSavatage Member Posts: 7,142
    how about creat 1 order - then use "copy document"
  • jannestigjannestig Member Posts: 1,000
    Why not look at the function get STD CUST Sales codes.

    This has all the items already existing against a customer and can be used again and again. If the customer is know this would seem a more logical choice for generating sales orders of known items
  • kinekine Member Posts: 12,562
    Just "simulate" the processing in same way as if you enter the order manually - do it just in C/AL

    In general:

    Create header
    set document type
    validate No.
    INSERT(True)
    Validate other fields
    MODIFY(True)

    Create lines
    fill PK fields (Doc. type, no., line no.)
    INSERT(True)
    Validate other fields
    MODIFY(True)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • slmaluwaslmaluwa Member Posts: 366
    Thank you kine & others

    What kine has suggested is I am looking for.
    I will do a R&D on this method and see what happens.

    Thanks again

    Maluwa
    "A bove maiore discit arare minor"-"From the old ox, the young one learns to plow."
Sign In or Register to comment.