NAV 2016 Eventing: All published Integration and Business events

It’s been a while since I’ve put up a decent blogpost. Well .. I’ve been busy at conferences, to be honest doing lots of Sessions. And I’m always nervous for these – I take it seriously, you know – people pay a lot of money to come to conferences like that, and the sessions need to be good. So .. I do my best .. and hope to succeed ;-)..

Best Practices for NAV Extensions

One of my sessions was about Best Practices on the exciting new feature in NAV 2016: NAV Extensions. You will read all about it in the near future, when I can find time to blog about the content.

One of the tips that I showed was how to find all Integration and Business events in the product. Well .. you know me .. I created a PowerShell script for that :-). People have been contacting me for this script, so here you are:

$DistriText = [System.IO.File]::OpenText('C:\Temp\AllObjects.txt')

$ResultArray = @()
$CurrentObject = ''
$i = 0

for(;;) {
    $TextLine = $DistriText.ReadLine()
    
    if ($TextLine -eq $null) { break }

    $i++

    switch ($true)
    {
        {$Textline.Contains("OBJECT ")} {$CurrentObject = $TextLine.TrimStart()}
        {$Textline.Contains("  [Integration")} {$CurrentEventType = $TextLine.TrimStart()}
        {$Textline.Contains("  [Business")} {$CurrentEventType = $TextLine.TrimStart()}
        
        {$Textline.Contains(" PROCEDURE") -and !([String]::IsNullOrEmpty($CurrentEventType))} {
            $CurrentFunction = $TextLine.TrimStart()

            $MyObject = New-Object System.Object
            $MyObject | Add-Member -MemberType NoteProperty -Name Object -Value $CurrentObject
            $MyObject | Add-Member -MemberType NoteProperty -Name EventType -Value $CurrentEventType
            $MyObject | Add-Member -MemberType NoteProperty -Name Function -Value $CurrentFunction            
            $ResultArray += $MyObject

            $CurrentEventType = ''
        }             

        Default {}
    }

    Write-Progress -Activity "Reading through objects.." -Status $CurrentObject

}

$DistriText.Close()
$DistriText.Dispose()

$ResultArray | ogv

 

The concept is simple: you just feed it a complete textfile of all objects of a certain database, and it will give you a list of events in a gridview.

If you want the official list of Microsoft on MSDN, you can find it here (thanks to Joe Mathis to send me this link). I don’t know how well this is being maintained, but hey .. now you at least got two resources ;-).

Enjoy!

5.00 avg. rating (97% score) - 2 votes

Permanent link to this article: http://www.waldo.be/2015/11/02/nav-2016-eventing-all-published-integration-and-business-events/

1 comment

10 pings

Skip to comment form

    • Michael Promberger on December 20, 2016 at 10:41 am
    • Reply

    Hi Waldo,

    like your script, like your blog, want to give a little feedback on your infinity loop construct.

    Here is the strange thing we observed:
    We just tried to implement a small Code analyzer by taking your script and ammending the Content of the loop a little bit to, well, do our Code analysing things.

    Thereby, we noticed a Problem with the “infinity loop construct”

    for(;;) {
        $TextLine = $DistriText.ReadLine()
        
        if ($TextLine -eq $null) { break }

    SomeCode …
    }

    In some cases, at runtime, the loop leads to a breakdown of the PowerShell Environment.
    Even if “SomeCode” is deactivated by a “if ($false) {SomeCode}” construct.
    Really strange …

    If the infinity Loop is constructed via “for ($dummy = 1; $false; $dummy++) { …}”, anything works.

  1. […] This is done using Integration or Business events that Microsoft implements in the product. Currently there are 128 of them. You can easily find them using the script from Waldo’s blog. […]

  2. […] Bron : Waldo’s Blog Lees meer… […]

  3. […] This is done using Integration or Business events that Microsoft implements in the product. Currently there are 128 of them. You can easily find them using the script from Waldo’s blog. […]

  4. […] NAV 2016 Eventing: All published Integration and Business events […]

  5. […] NAV 2016 Eventing: All published Integration and Business events […]

  6. […] might remember my blog “NAV 2016 Eventing: All published Integration and Business events“. I provided a script that showed all the Events in NAV. Well .. I wanted to know more. Much […]

  7. […] might remember my blog “NAV 2016 Eventing: All published Integration and Business events“. I provided a script that showed all the Events in NAV. Well .. I wanted to know more. Much […]

  8. […] might remember my blog “NAV 2016 Eventing: All published Integration and Business events“. I provided a script that showed all the Events in NAV. Well .. I wanted to know more. Much […]

  9. […] To find all integration and business events of your database, you can run a script described by Waldo in here: http://www.waldo.be/2015/11/02/nav-2016-eventing-all-published-integration-and-business-events/ […]

Leave a Reply to Michael Promberger Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: