Tuesday, March 25, 2014

Wrong number of arguments to - optional parameter

Example
Let's say the procedure has this definition in GP2013 SP1
{ procedure DoStuff}
inout integer a;

Then in GP2013 SP2 it gets an optional parameter, like so:

{ procedure DoStuff}
inout integer a;
optional inout integer b;

If your dictionary is built on SP1 and wasn't recompiled against SP2, then this will result in "Wrong number of arguments to DoStuff". It doesn't matter that the new parameter is optional, the dictionary still has to be recompiled.



Thursday, March 20, 2014

Debugging Dynamics GP - searching for messages

Figure out the message number
1. Search in Messages

2. SELECT * FROM SY01700
WHERE ERMSGTXT LIKE '%message text%'

Search for the message in the code
if you got it from Messages, then search for getmsg(MessageNumber)

if you got it from the SY01700 table, search for Warning_Dialog, MessageNumber

Look in = start with Selected Form, if you know which form the message is coming from for sure. Then search in All Dictionary Scripts if you still can't find it.

Example
Message text = "Quantities must be distributed before you can save this item."

Searched Messages, nope.

Executed SELECT * FROM SY01700
WHERE ERMSGTXT LIKE '%Quantities must be distributed before you can save this item.%'     

This returns the row with message number 33107. Since i got it from the table I then search for Warning_Dialog, 33107

First i limit the search to "Selected form". In this case it returned one script. So i know that's where the message is popping up
                                                                                                                                                                                         

Monday, March 10, 2014

Dexterity's inconsistent use of -based indexing

In Dynamics Dexterity array's are 1-based indexed, whereas radio groups are 0-based indexed.

This catches me off guard on a regular basis, because i don't just use Dexterity, i use .NET and other frameworks and languages. So the 1-based indexing really throws me off alot. 

I understand that the original language designers probably thought that 1-based indexing would be more "user friendly", or whatever their goal was, but why wouldn't you keep that consistent? Why would radio groups be 0-based indexed.

Thursday, March 6, 2014

Windows Service not appearing in services list after install

Problem
After running a service installer I am not seeing the service in the services list, and trying to start the service results in it saying something like "The service is not on this computer"
Note: The installer was made in a VS Setup project
Solution
Luckily i found the solution right away on Stack Overflow.
According to this: http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx you need to do the following steps to ensure the service executable is registered as a service:
1.In Solution Explorer, right-click the setup project, point to View, then choose Custom Actions. The Custom Actions editor appears.
2.In the Custom Actions editor, right-click the Custom Actions node and choose Add Custom Action. The Select Item in Project dialog box appears.
3.Double-click the application folder in the list box to open it, select primary output from MyNewService (Active), and click OK. The primary output is added to all four nodes of the custom actions � Install, Commit, Rollback, and Uninstall.
4.Build the setup project.

References
 http://stackoverflow.com/questions/1560407/windows-service-not-appearing-in-services-list-after-install
There was an error in this gadget