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!
1 comment
10 pings
Skip to comment form
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.
[…] Continue reading » […]
[…] 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. […]
[…] Bron : Waldo’s Blog Lees meer… […]
[…] 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. […]
[…] NAV 2016 Eventing: All published Integration and Business events […]
[…] NAV 2016 Eventing: All published Integration and Business events […]
[…] 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 […]
[…] 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 […]
[…] 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 […]
[…] 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/ […]