Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Release sales order from code NAV 2017

Posted on by 768

I Want to create a custom code unite in which it get the sales order no as a parameter and Release the sales order in NAV 2017.

Thanks in Advance 

*This post is locked for comments

  • RE: Release sales order from code NAV 2017

    Thank you sir 

  • Verified answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: Release sales order from code NAV 2017

    you can use codeunit 80 to post sales documents.

    add a new global function "Post(Rec : record "Sales Header")" in the new cu "Sales Lib":

    add this code:

    // maybe set flags Ship and Invoice from Rec here

    SalesPost.RUN(Rec); // local variable SalesPost : codeunit : 80

    after saving the cu, goto c# project and update web reference to get the new function in c# code

  • RE: Release sales order from code NAV 2017

    Thank YOU for your help Solved the error now it work perfectly Thanks.

    sir one another Question how to post sales order from code?

  • Verified answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: Release sales order from code NAV 2017

    when you click on that link, you see some xml structure in the IE (browser) ?

    use the ip address instead of the computer name, in your case 127.0.0.1

  • RE: Release sales order from code NAV 2017

    sir i already used that url pc/.../SalesOrder

    no error in the code as you told i did on the same way when i run the code then show the above error

  • Verified answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: Release sales order from code NAV 2017

    did you publish the sales order page in the web service list in nav. you should get there a soap url, please check that, click there on the link, you should then get an xml structure shown in the browser. this link is to be used for the web reference.

  • RE: Release sales order from code NAV 2017

    when run the url has change and say page not found how to solve this sir Please sir i need your help 

  • RE: Release sales order from code NAV 2017

    var order = client.Read(orderNo);

    error detail {"Service \"CRONUS Canada%2C Inc./Page/SalesOrder\" was not found!"}

  • RE: Release sales order from code NAV 2017

    sir no error but when run the code  error here   var order = client.Read(orderNo);

    error detail {"Service \"CRONUS Canada%2C Inc./Page/SalesOrder\" was not found!"}

  • Verified answer
    keoma Profile Picture
    keoma 32,675 on at
    RE: Release sales order from code NAV 2017

    you have to add a web reference, so right click the c# projects name, select add service reference, then in the dialog click on web reference, set there the soap url of the nav web service.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans