web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to trigger NAV native code or background operation through code

(0) ShareShare
ReportReport
Posted on by

Hi ,

I am trying to Sync data from sourcedb to NAV. For that i am using windows service to sync data using Sql statements to insert data from sourcedb to NAV. It is working as expected but the issue i am facing is like in NAV there are some operations which got triggered if i do something on UI. Suppose for Invoice if i create a new invoice from UI and select a customer no it will automatically fill details related to that like Customer Name ,amount etc but if i map customer no field through sql query it wont trigger this process and fill the related data.

Can anyone suggest me what is the best and easy approach to trigger this process so that it automatically fill the rest of the data through code because i have to use that windows service to sync data between these two db.

Thanks

*This post is locked for comments

I have the same question (0)
  • Rashed Profile Picture
    3,765 on at
    RE: How to trigger NAV native code or background operation through code

    use webservice to update nav instead of directly through sql.

  • Suggested answer
    4BzSoftware Profile Picture
    6,073 on at
    RE: How to trigger NAV native code or background operation through code

    Hi,

    SQL statements directly insert data into NAV database make information inconsistency and system error. You should keep NAV business logic by invoking NAV Web Service. Hope below Youtube video is helpful for you:

    www.youtube.com/watch

  • Suggested answer
    Mouli Kaku Profile Picture
    517 on at
    RE: How to trigger NAV native code or background operation through code

    Web services is best option if you can not use insert data directly into a temp table and process the data from there use using job queue to relevant table.

  • Verified answer
    Alexander Ermakov Profile Picture
    28,096 on at
    RE: How to trigger NAV native code or background operation through code

    As other members suggested, I would also not recommend to use direct data injection via SQL. You would need a deep knowledge of how to fill in all the tables that are in relation to each other. Even then you have a huge risk of data inconsistency. Better to import needed data using web service (msdn.microsoft.com/.../dd355398(v=nav.90).aspx) or XML-port (msdn.microsoft.com/.../dd338846(v=nav.90).aspx).

  • Suggested answer
    Zaid Tariq Profile Picture
    2,274 on at
    RE: How to trigger NAV native code or background operation through code

    Hi,
    Use webservice to insert and if you also want to run your own custom logic as background use Events along with this. Thanks

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

#1
Saurav.Dhyani Profile Picture

Saurav.Dhyani 2 Super User 2025 Season 2

#2
RK-25090803-0 Profile Picture

RK-25090803-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans