Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

C# Event trigger in C/AL

Posted on by Microsoft Employee

How to stop Nav from continue process and wait for the trigger in c#.

The situation is like this:

1. I need to pass in some value to c# to process.

2. In the c#, there is a web service which will process the value I pass in from nav.

3. The process value will return in delegate event trigger in c#.

4. Then the value will return to nav when the delegate event is triggered. 

The problem is, nav will continue to run even the value is not return yet from the c#. Is there anyway I can stop nav from processing and wait until the value from c# is return?

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: C# Event trigger in C/AL

    I declare a Global variable with dotnet type. set the withevents properties to yes.

    On the same codeunit, on run trigger I initiate the instance and called 'CalValues' from c#.

    I did tried with sleep, after sleep the nav continue to process the next statement instead process the c# trigger function in nav.

  • Suggested answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: C# Event trigger in C/AL

    Cheng,

    How are you calling your function in C# ? You can use SLEEP function to wait and check for return value.

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans