Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Writing to windows error log

(0) ShareShare
ReportReport
Posted on by 1,695
Further to a previous post, I have now managed to write to the windows error log, however im not getting the information I need to track the error

I am creating a workflow on a develop machine and publishing it to a development crm system on s different machine

When the entry in the log gets generated all I get in the error log is ;

The description for Event ID 1 from source Dynamics cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.
The following information was included with the event:
Licence XXXXXX Serial Number XXXXXX
Import Legacy transactions - Create Transactions An unexpected error occurred.
the message resource is present but the message is not found in the string/message table
My code 
   Public Shared Function WriteToEventLog(strEvent As String, strLicence As String, strFileSerial As String) As Boolean
        Dim eventlog As EventLog
        Dim LogSource As String = "Dynamics"
        Dim LogName As String = "Application"
        Try

            If Not System.Diagnostics.EventLog.SourceExists(LogSource) Then
                System.Diagnostics.EventLog.CreateEventSource(LogSource, LogName)
            End If

            eventlog = New System.Diagnostics.EventLog()
            eventlog.Source = LogSource
            eventlog.WriteEntry("Licence " & strLicence & " Serial Number " & strFileSerial & vbCrLf & strEvent, EventLogEntryType.Warning, 1)


            Return True

        Catch ex As Exception
            Return False
        End Try
        Return False
    End Function

*This post is locked for comments

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans