Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Creating new saleslines with events

Posted on by 255

Hey Dynamics users,

i'm working on a customization, that needs to be implemented using events. to keep it short, i have a list of items that has a relation to one item. For example, itemA has a relation to ItemB etc.  on a sales order, when a choose ItemA, i also want Item be to appear below it. I'm am a litte bit in doubt on which event i need to subscribe. OnAfterInsert or OnAfterValidate.  I hope someone will guide me to a solution. Thank you.

*This post is locked for comments

  • Suggested answer
    Alexander Ermakov Profile Picture
    Alexander Ermakov 28,094 on at
    RE: Creating new saleslines with events

    You can try to achieve this without customizations... If you are selling bundles of items, e.g., you can create BOM with ItemA and ItemB, select it in the Sales Order and then explode...

  • Verified answer
    Yogesh Kulkarni_ Profile Picture
    Yogesh Kulkarni_ 1,762 on at
    RE: Creating new saleslines with events

    You need to subscribe to OnAfterInsert event.

    And you need to insert another record in the same Sales Order with No. as ItemB and LineNo. as previous one + 10000.

     

    -Yogesh Kulkarni
    Please verify, if you find answer helpful.

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans