The Dev Guy

The Dev Guy

Friday, August 22, 2014

Dynamics GP Web Service Install Error: The security ID structure is invalid (Exception from HRESULT: 0x80070539)


 

Goal 

You are installing GP Web Services and keep getting  an error that rolls back the install. You get an error saying: The security ID structure is invalid (Exception from HRESULT: 0x80070539). 
You need to fix the error and get it installed.  



Environment

SQL 2008 or later, Windows 2008 or later, GP Dynamics 2010 or 2013.

Issue

            The issue of all things is that there is a user in the model database that is not windows authentication based.


Resolution                                             

            Just Delete the user from the Database:
1) Goto Enterprise Manager
2) Drill down to the system databases and then the model database
3) Find the user that is not windows based (NOT THE dbo User!)
4) Delete the user from the database

Then restart the install process.
 

Conclusion 

Web Service Configuration for GP requires that the model database NOT have a user in it that is sql authentication based (login is sql not windows).

 

 

Sunday, August 10, 2014

Open Error Log in NOTEPAD after error in Dynamics SL


Goal 

You have created a Dynamics SL 2011 Custom Screen using the Tools for Visual Basic.  Your Screen processes information using the Status Function from the SWIMAPI.dll. The Status Function uses the process screen for SL and allows you to log messages in a log file that is placed in the eventlog folder of SL.  At the end of processing, if there were errors, it will say process is complete and the log file is in that eventlog directory. The filename is generated by the process.  

This is all fine but some users do not go surfing for files. A better solution may be to open the log file in notepad automatically instead of making the user find it and open it.

The goal here is to open the log file created after a dynamics SL process in notepad.



Environment

SQL Server 2008 or 2012  and Dynamics SL 2011.

We are developing in Visual Studio 2010. Please see my other post on how to get around the 64 bit issue.

Issue

            If you are like me, you are very familiar with the Launch function in vba but how to open notepad in vb.net is not something I do all the time. Also knowing the directory and name of the log file, how to get that from SL? This is not difficult just requires some logistics to do.          

 

Resolution                                             

            In order to accomplish all of this:

1)      I used the pstatus table. This is in all application databases and everytime you log something to a log file in sql, the new file name is saved there in the zfilename field, the screen, user, date and time is stored too

2)      I identify the record by taking the records in pstatus with user = current user (bpes.userid) and processdate = today and screen = current screen (bpes.ScrnNbr) and process time is the latest in the table for all the fields just listed.

3)      Finally I use the System.Diagnostics.Process.Start() to launch NotePad.exe.

 

The Sub used to open the file looks like below:

 

Private Sub LaunchError()

 

Dim d As DateTime = Now

 

Dim sFile As String = ""

Call SqlCursor(csr_PStatus, NOLEVEL + SqlFastReadOnly)

serr9 = SqlFetch1(csr_PStatus, "Select * from PStatus where userid = "&    SParm(bpes.UserId) & " and PID = " &

SParm(Trim(bpes.ScrnNbr) & "00") & " and  ExecDate = '" &d.ToString("MM/dd/yyyy") & "' and ExecTime in (Select Max(ExecTime) from PStatus where userid = " & SParm(bpes.UserId) & " and PID = " &SParm(Trim(bpes.ScrnNbr) & "00")& " and  ExecDate = '" & d.ToString("MM/dd/yyyy")& "')", bPStatus)

        If serr9 <> NOTFOUND Then

            sFile = Trim(bPStatus.zfilename)

        End If

        Call SqlFree(csr_PStatus)

        If Trim(sFile) <> "" Then

            System.Diagnostics.Process.Start("Notepad.Exe", sFile)

 

        End If

End Sub

 

The code I use to launch this sub is:

 

                ' call final screen (process complete with log file at following location)

 

Call MessBox(sStuff, MB_OK, bpes.ScrnNbr)

 

' After user closes the above screen (dialog screen)  check for any errors in ‘ ‘process and if there are then call the laucherror

 

 

        If bErrors Then

            LaunchError()

 

        End If

 

 

Conclusion 

 

It is standard procedure to use the process screen when processing data in Dynamics SL. You use the status call to use it and it helps you log data to a log file in the eventlog directory of SL. The problem is that most users are not savy enough to surf folders for a log file and figure what is wrong. As step in the right direction is to open the file in notepad so the user can easily read it. That is what we do here.

 

 

Monday, July 14, 2014

Upgraded Custom Screens from SL 6.5 to SL 2011 get Error 10127


Goal 

You need to upgrade SL 6.5 Screens to Dynamics SL 2011. You run the conversion utility and after opening your screens in SL in 2011, you get a Programming Bulletproof Error 10127. The message gives further text of 2 or more controls have the same name of Form1. And Form1.. You look until your eyes pop out and there is no control with no name let alone two of them.   

Environment

SQL 2012, Windows Server 2008 or Windows Server 2012, and Dynamics SL 2011.

We are developing in Visual Studio 2010. Please see my other post on how to get around the 64 bit issue.

Issue

            The issue is that every time you open the screen after upgrade you get the annoying prompt described above. The screen opens but you have to click to click ok on that message every time.

 


Resolution                                             

           

            If you are getting this message then you have multiple SSTabs (Windows.Forms.Controls.Tab) with a grid on each tab. You also have a groupbox on each tab. Groupboxes are used by Dynamics SL to group controls together to go in a Grid.  You don't need a Groupbox to do that in the last tab of SSTab. You have to delete the last groupbox and put the controls directly on the last tab. Highlight all the controls on the last tab (including the spread control), hit ctrl-x (cutting the controls). Hit the groupbox and hit delete key (thus deleting the groupbox), then hit ctrl-c (pasting the controls back on the form). Now recompile and redeploy. No more message.

 


 

Conclusion 

 

            SSTabs in 6.5 had groupboxes around all controls that belonged on a grid. 2011 does the same but with one exception: if a Tab control has multiple tabs, each with a grid on it, then each tab needs a groupbox EXCEPT the last tab. How I figured this out I don’t know…
Things to maybe try that I did not: Add a blank tab and make it invisible.

Thursday, May 8, 2014

.NET Framework 4.0 and Tools for Visual Basic for Dynamics SL


Goal 

You need to use tools in .NET that require the 4.0 framework in a project that uses also the Visual Basic tools for Dynamics SL 2011. I recently ran across this because I was using the infragistic controls for Windows Forms with Dynamics SL custom screens.   

Environment

Windows Server 2012, Dynamics SL 2011, and Visual Studio 10.

Issue

               When you compile the project after changing to .net 4.0 framework you get a File Load error like below.

Problem signature:

  Problem Event Name:                        CLR20r3

  Problem Signature 01:                       ga11100.exe

  Problem Signature 02:                       1.0.5240.29754

  Problem Signature 03:                       536aa6a0

  Problem Signature 04:                       Microsoft.VisualBasic

  Problem Signature 05:                       10.0.0.0

  Problem Signature 06:                       4ba2183b

  Problem Signature 07:                       96

  Problem Signature 08:                       2c

  Problem Signature 09:                       System.IO.FileLoadException

  OS Version:                                          6.1.7601.2.1.0.16.7

  Locale ID:                                             1033

  Additional Information 1:                  0a9e

  Additional Information 2:                  0a9e372d3b4ad19135b953a78882e789

  Additional Information 3:                  0a9e

  Additional Information 4:                  0a9e372d3b4ad19135b953a78882e789

 

Read our privacy statement online:

  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

 

If the online privacy statement is not available, please read our privacy statement offline:

  C:\Windows\system32\en-US\erofflps.txt

 

 

Resolution

There is none. Tools for Visual Basic will not work beyond framework 3.5.  So in my case I am walking back a version in the third party.


Conclusion 

 

Tools for visual basic require you use .net Framework 3.5 or earlier.  Sorry I have no tricks on this but you should know.