Skip to main content

Notifications

Microsoft Dynamics NAV (Archived)

Can you skip codeunits and insert directly to database directly from external application?

Posted on by Microsoft Employee

Hey, I've only recently started developing on Microsoft dynamics NAV and someone suggested to me to write a C# application that writes directly into the database rather than consuming web services exposed in NAV. I have a feeling there could be something terribly wrong with doing that for a database being used by Microsoft Dynamics NAV but don't know what. Could that really work?

*This post is locked for comments

  • _QWERTY Profile Picture
    _QWERTY 10 on at
    RE: Can you skip codeunits and insert directly to database directly from external application?

    Besides table triggers, you need to be aware, that your Server Instance don't know that you have been updating the data. If the data you have changed has already been Cached in your Server Instance, it won't be updated before you force it to update. So your users might get outdated data from your Server Instance Cache.

  • Suggested answer
    RE: Can you skip codeunits and insert directly to database directly from external application?

    Hi,

    You may write a C# code to directly write on the database. As Mohana said, if your requirement is not about checking validations or calculations, then you can though it is not recommended.

    Hope it helps.

  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,137 Super User 2024 Season 2 on at
    RE: Can you skip codeunits and insert directly to database directly from external application?

    it depends upon your requirement.

    if you are importing to an intermediate table and later process the data then it is fine.

    codeunits and table triggers will execute some code to calculate and validate..

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans