Pages

Friday, May 29, 2009

After a long writing hiatus, MVP Frank Hamelly on his gp2themax blog explains how to setup the often overlooked Accounts Rollup feature which he describes as "not as tasty as fruit rollups, but equally satisfying".Frank also explains how to use Microsoft Dynamics GP's Navigation Pane to organize SmartLists for the end-users. His narrative is based on a requirement posed by the client at an actual project we both had the opportunity to work and collaborate on.

Please be sure to read Frank's articles as you will find a lot of interesting things from his personal experience.

Unless you have been working with Dynamics GP from the days of Ctree and Btrieve, it is quite difficult to comprehend why Dynamics GP seems to behave (as in act up) in certain ways on SQL Server -- how would I say this... not quite like your other Windows applications that run on SQL Server.

To understand some of these behavioral issues, David Musgrave brings a two-part series on Understanding how Microsoft Dynamics GP works with Microsoft SQL Server -- if it was my article I would have labeled it Dynamics GP technological idiosyncrasies, but then again, I did not write it. :-)

Ever wonder why the cryptic table names and columns? A lot of it has to do with the origins of the application and the multiple operating systems and ISAM platforms supported back in the 80's and 90's. Know your Microsoft Dynamics GP history... in the early days, long before Microsoft SQL Server, Dynamics GP ran on the Mac OS platform and supported Ctree and Btrieve as file server platforms. I guess at the end of the day, the development team figured it would be a daunting effort to make those tables and columns names meaningful for SQL Server.

Thursday, May 28, 2009

I recently came across a question as to how to move data across Dynamics GP companies. It then became almost an instant challenge to find all the possible answers to this question and while I don't claim to have them all, I will point out as many methods (and resources) I could think of. If you have used other methods I would certainly value your input to this post.

So here we go:

Method 1. SQL Server Backup/Restore.This method assumes you will be creating an exact copy of the production data for either test purposes or as a simple fall back method for recovery purposes. See KB article 871973 for more information on how to create a mirrored copy of your GP data.

Method 2. Support Debugging ToolYou can use Support Debugging Tool's XML Export and XML Import features to select specific tables to transfer. If transfering master tables, KB article 872709 lists the tables you will need to select for the transfer.

Method 3. Integration ManagerIntegration Manager is still one of the best methods to transfer data between companies, especially at the end of an implementation, when you need to import master records and beginning balances into a production company that were previously recorded in a test company. Integration Manager can be found on your Microsoft Dynamics GP installation CDs. The following are links to the latest Integration Manager updates:

Method 4. SnapShot for Microsoft Dynamics GPWritten by David Musgrave, SnapShot works by copying the contents of selected tables to Ctree files in a separate folder, thus creating a SnapShot of the data. This separate folder can then be copied to a target system and the data inserted back into the actual tables. For more information on SnapShot and to download the product, visit the Developing for Dynamics GP website here.

Method 5. Company Setup Automated SolutionIf the purpose is to transfer only setup information, then you will want to try the automated solution offered by Microsoft. The automated solution can be found here (CustomerSource/PartnerSource access required). For more information on Automated Solutions check out my previous article here.

Method 6. Table ImportTable Import is the forgotten tool. As many new and more robust tools are developed, this tool seems to drop to the bottom of the memory lane. Don't forget that Table Import can bring data into specific GP tables that are not supported by the tools. Click here for more information about Table Import.

Hope you find these methods useful and contribute to the article with other methods you have used.

Thursday, May 21, 2009

The purpose of this article is to describe how to identify your current Microsoft SQL Server version number and the corresponding product or service pack level. It also describes how to identify the specific edition of SQL Server you are using in your environment.

How to determine which version of SQL Server 2008 is running

To determine which version of Microsoft SQL Server 2008 is running, connect to SQL Server 2008 by using SQL Server Management Studio, and then run the following Transact-SQL statement.

For releases of SQL Server prior to SQL Server 2000, check Microsoft Support KB article 31185. Keep in mind also there were a number of Cumulative Updates for each version, which are not listed above. For a detail list of Cumulative Updates version information check SQL Team's article on SQL Server Versions.

Wednesday, May 20, 2009

It seems that nowadays we can add security to pretty much every aspect of the Microsoft Dynamics GP application, but when it comes to VBA projects things are not too clear for many developers and Dynamics GP systems administrators.

2. Open the project's Properties window. Right-click on the project within Project Explorer and select the project Properties option. You can also access the project Properties window by highlighting the project and using the Tools menu.

3. Click on the Protection tab, then click on the Lock project for viewing checkmark.

4. Enter a password to prevent unauthorized access, then confirm the password entered.

5. Press Ok to apply the settings.

6. Save your VBA project and exit Dynamics GP. When you access the application next time and attempt to access your VBA project you will be prompted to enter a password to display it's content.

If you have multiple projects, you will need to apply security individually to each by following the above outlined steps. Hopefully you will use the same password across to make things easier :-)

Monday, May 18, 2009

How many times have you wished you could save and print a sales order, a fullfillment order, or an invoice document, with their corresponding packing slips and picking tickets all in one step? The SOP Quick Print feature offers just that! Written by my friend David Musgrave, and a standard part of Microsoft Dynamics GP, it's one of the most overlooked (or perhaps, unknown) yet, one of the most requested options by users working with SOP.

David says "Just set it up with the Keep Current Document Displayed option unchecked.Then instead of saving and then printing. Just use Ctrl-Q to quick Print.That will then save the document and print it.That's what I wrote the feature for."

To access the setup window, click on the Options menu on the Sales Transaction Entry screen, then select Quick Print Setup. You can configure additional options even for packing slips and picking tickets, along with report output settings. You can also choose to let the document remain on the screen even after printed.

Once configured, you can then begin to enter your documents or select previously entered ones, then hit CTRL+Q from your keyboard. That's it! Your document is saved then printed, all in one step! One of the most important benefits of this feature is, you don't need to create your own customization.

Friday, May 15, 2009

Well, everyday I learn something new. My friend and fellow MVP Victoria Yudin had been wondering what could be the possible values stored in the PSTGSTUS ('Posting Status') column of the tables dbo.SOP10100 (technical name: SOP_HDR_WORK) and dbo.SOP30200 (technical name: SOP_HDR_HIST) statuses as a result of a posting operation in Sales Order Processing.

In fact, just recently on the Dynamics GP Newsgroup, someone reported seing a status 508 in the SOP30200 table. The complete list was provided by a Microsoft support engineer on the Partners forum -- take note as they are not documented in the SDK.

Transcript

All transactions in SOP10100 that have not been posted yet should have a PSTGSTUS value of 0 (unposted). This value of this field will change to 2 (posted) when posted and the record will move to SOP30200. With this in mind, all transactions in SOP10100 should have PSTGSTUS value of 0 and all transactions in SOP30200 should have PSTGSTUS value of 2 (posted). Any other values in either table would indicate that there was a posting interruption.

I have found invalid values of 12, 14, 508, etc. These values may have been assigned to the record in different stages of the posting process. Meaning, the posting process did not complete and the transactions need to be recovered in the Batch Recovery window.

a. PSTGSTUS is assigned the value of 7 while GP is checking for duplicate Document Numbers.b. PSTGSTUS is assigned the value of 12 while GP is verifying the accuracy of the amounts between the detail and header records.c. PSTGSTUS is assigned the value of 14 while GP is calculating that the total detail amounts match the header amount.d. PSTGSTUS is assigned the value of 508 while GP is is in the process of transferring the record from Work (SOP10100) to History (SOP30200).e. PSTGSTUS is assigned the value of 600 while GP is validating if the detail and header records match in the History tables (SOP30200 and SOP30300).f. PSTGSTUS is assigned the value of 2 upon the end of the posting process.

In this example, if the posting process was interrupted after step a, then the record will still be in SOP10100 with a PSTGSTUS = 7. Or, if the posting process was interrupted after step d, then the transaction may still be in SOP10100 with a PSTGSTUS = 508.

The example above is not the exact posting process in GP. This is just a way of showing how a record in SOP10100 can have a PSTGSTUS value other than 0 and 2.

I must personally add that a transaction will only make it to SOP30200 with statuses of 2 or 3, as the transcript indicates, the other status are more used as a workflow within the posting process than really a status.

Thursday, May 14, 2009

A few days aback I addressed an issue where the user needed to set the 1099 Box on the vendor import with Integration Manager. To my surprise, while there is a field to map the 1099 Type, there is no 1099 Box field in the Options collection in the Vendor import in IM. To make matters a bit more interesting, the user needed to have the 1099 Box filled based on some settings in the source system.

Solution

The 1099 Box is not accessible via Integration Manager, however we can create a small SQL Server stored procedure in the company database that will accept the vendor ID and the 1099 Box as parameters. The stored procedure in turn will update the vendor record with the value submitted.

If pRetVal.Value <> 0 Then' Error handling here, you can choose to write to IM's logEnd If

Since I am making use of global variables, gVendorID and gBoxNumber, we will need to capture both of these values in the vendor ID field script -- we will no longer map the vendor ID since it's necessary to use a field script.

This conclude our integration! Don't get discourage if you don't see a specific field mapping in IM. With little creativity and the right mindset you can always come around with a solution that is worth showcasing.

Tuesday, May 12, 2009

Global English Partner Online Technical Communities upgraded to the forum platform since Apr 27, 2009, at 9:00am PST. I have to say I have been quite excited lately working on the new Dynamics GP (Partners) forum platform. Forums defer from Newsgroups in that these are moderated by Microsoft employees and are exclusive to Microsoft partners who are Registered members, Certified members, or Gold Certified members -- this is, they are not public.

Monday, May 11, 2009

Folks, this one can rather come across as a brain teaser or a catchy certification question, but don't be surprised by how often I get asked during a demo and how often I -- and many others -- have automatically provided the unequivocal answer "Unlimited!". The question comes in various flavors, for example:

How many distributions can I add to a journal entry?

How many line items can I add to a Sales document?

How many line items can I add on a Purchase Order?

Unlimited? The truth is, there is a limit to everything, whether the contraints are imposed by physical storage capacity or by a data type definition, the fact is, it's nonetheless a limit.

So let's take a look.

The Line Sequence Number field in Dynamics GP is generally defined as an integer value. According to Microsoft SQL Server Books Online, an integer requires 4 bytes of storage, which means it can any number between -2^31 and 2^31 or -2,147,483,647 and 2,147,483,647. Now consider this, the first line sequence number in a scrolling window is generally initialized with a value of 16,384 or 2^14, so mathematically speaking, a user will be able to add 131,072 lines or 2^17 before they hit an error and have to resort to inserting distribution lines in between the previous 131,072 ones.

I don't know about you, but 131,072 lines in a scrolling window sound like quite a bit of lines -- but certainly not unlimited -- before you even begin to consider inserting lines in between, but you never know when you will come across that one customer who will push the system to it's limit.

Wednesday, May 6, 2009

Not too long ago, I answered a pretty interesting question on the Dynamics GP newsgroup. The user's company images signed delivery tickets and store these as PDF documents on a shared location on their network. The PDF document is named after the corresponding invoice number in Dynamics GP, for example, if the invoice number is INV010001, the corresponding image of the delivery ticket would be stored as INV010001.PDF

The user wanted to know if it was possible to create a smartlist to show invoices without a scanned PDF image of the delivery ticket.

Solution

When you think of this problem from the eyes of a user, it seems almost impossible to write a SmartList that would produce the results wanted by the user. But when you breakdown the problem, the real issue is, how do we create a SQL Server view that is able to show whether a file exists for a specific Dynamics GP invoice document.

The solution is to create a SQL Server user-defined function (UDF) that is able to return whether a file exists or not. Then we can incorporate this UDF into our view query. Since views can be addressed from SmartList Builder then we are good to go.

Note the call to the dbo.IsFileExists UDF. With the view in place you can follow standard SmartList Builder procedures to implement and deploy the view. For information managing security and changes to SmartList Builder smartlist click here.

Monday, May 4, 2009

In Part 1 of this series you saw how to leverage a Common Table Expression (CTE) query with the use of the T-SQL OVER clause to determine the ordinal position of a line item displayed in a scrolling window. The ordinality is calculated based on the Line Sequence Number stored by Dynamics GP, but frees the developer of having to use complex formulas -- thay may or may not always work -- to determine ordinality of an item within the set. Continuing with our series, we will now explore how to use these scripts with VBA and Dexterity to retrieve the ordinal position value to use within any customization.

First, we will convert one of our scripts to a SQL Server stored procedure that can accept, say a document number, document type, and an item number and will then return the ordinal value.

-- we will only retrieve the first occurrence as there may be -- more than one line item for the same item number SELECT TOP 1 @ORD = ORD FROM @SOPDocs WHERE (SOPTYPE = @SOPTYPE) AND (SOPNUMBE = @SOPNUMBE) AND (ITEMNMBR = @ITEMNMBR);GO

GRANT EXECUTE ON dbo.getSOPLineOrdinalValue TO DYNGRP;GO

NOTE: This query is only supported on SQL Server 2005 and above.

A few things to note, before testing the stored procedure. The result set of the CTE will be stored in a table variable to avoid forcing an ordinality of 1 created by a WHERE clause on the SELECT statement of the CTE.

We are forcing the query on the table variable to return the first matching item in the set by using the TOP clause in the SELECT statement. This will prevent our query from returning multiple results to the @ORD output variable which would cause an error in the query execution.

To call this stored procedure from VBA we will use the following Dynamics GP Developer newsgroup case in which the developer wants to know how to retrieve the ordinality of a line number within the scrolling window and store the value in a custom table in another application. While I will not go to the extent adding code to store the value, I will however add a field to the scrolling window to show the line number of the line item being displayed.

For this example I have added the field '(L) LineNumber' with Modifier to the scrolling window. Then, back in Dynamics GP, I added the SOP Entry window to VBA along with the SOP Type DDL, the SOP Number, Item Number, and '(L) LineNumber' fields. Now the scripts:

The getSOPType() function converts the SOP Type DDL value to the SOP Type value as stored in the SOP table. Remember that the DDL list values do not correspond with the storage value for the SOP Types. For simplicity sake, I am using a VBA function to do this conversion, but as a best practice you should be using the native Dynamics dictionary SOPTypeToInt() function which can be accessed via pass-through Sanscript with the Continuum Integration Library.

The getSOPLineNumber() function will invoke our stored procedure to retrieve the actual ordinal value of the line number. As I write this, you can change the stored procedure to accept the Line Sequence Number as a parameter which would allow you to deal with multiple lines with the same item number.

Private Function getSOPLineNumber()

' Created by Mariano Gomez, MVPFunction getSOPLineNumber(nSOPType As Integer, sSOPNumber As String, sItemNumber As String) As Integer Dim oUser As New UserInfo Dim oCn As New ADODB.Connection Dim oCmd As New ADODB.Command Dim pSOPType, pSOPNumber As New ADODB.Parameter Dim pItemNumber, pOrder As New ADODB.Parameter

'Retrieve an ADO connection for the current user Set oCn = UserInfoGet.CreateADOConnection()

'Set the connection properties oCn.CursorLocation = adUseClient

'Set the current database, using the IntercompanyID property oCn.DefaultDatabase = UserInfoGet.IntercompanyID

Note that you can enhance this code to add the line number when the line change script is executed. This way, new line items in the window will also be numbered. I will provide the Dexterity technique as a comment entry to this article.

Related Articles:

Part 1 of the Series - On this blog, click here.Scrolling Windows and Line Sequence Numbers - On this blog, click here.

Sunday, May 3, 2009

One of the questions that most often come up in newsgroups and at client sites is, "how can I find the line number of an item on a *document*?", you can replace the word *document* for anything from a sales order, sales invoice all the way to a purchase order, purchase receipt, or invoicing invoice -- and pretty much any other thing you can think of.

The bottom line is, while Dynamics GP creates a line sequence number for every item entered in a scrolling window -- click here to see my past article on line sequence numbers and scrolling windows -- it is not very good at aiding users and/or developers in tracking the true ordinal value (1, 2, 3,.., n) of an item within the set of items on a document. So, I decided to give you a push by creating several T-SQL scripts that will help you identify these ordinal values. You can then take these same scripts and convert it into a SQL Server UDFs or stored procedures and call them from VBA or Dexterity if needed. I will also provide an example on these two techniques in Part 2 of this series.

NOTE: I am a big fan of SQL Server Common Table Expressions (CTE) and use those as often as I can to simplify my queries and avoid the use of subqueries. In addition, they tend to produce better query execution plans which translate into performance gains.

Please stay tuned! Part 2 of this series will show you how to take advantage of these queries from Dexterity and VBA.

About Me

Mariano Gomez is an innovative, award winning, results-driven entrepreneur, blogger, and EVP of Midmarket Solutions at Intelligent Partnerships, LLC. Under his tenure, Intelligent Partnerships has become a leading consulting firm providing management consulting and technology solutions for midmarket firms around the world.

Gomez is the author of The Dynamics GP Blogster, recognized by his peers and user community as a top Microsoft Dynamics GP blog; has been named Top 100 Microsoft Dynamics Most Influential People by DynamicsWorld UK. He has also delivered numerous presentations at Microsoft Dynamics Convergence, Microsoft Dynamics GP Technical Airlift, and the GP User Group Summit.

Where are you visiting from?

Disclaimers

This blog and its content is provided "AS IS" with no warranty of any kind, either expressed or implied, made in relation to the accuracy, reliability or content of the information herein. The author shall not be liable for any direct, indirect, incidental or consequential damages arising out of the use of, orinability to use, information or opinions expressed in this site and confers no rights.

ALL SCRIPTS ON THIS SITE ARE DISTRIBUTED IN THE HOPE THAT THEY WILL BE USEFUL, BUT WITHOUT ANY WARRANTY. THEY ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF SUCH SCRIPTS IS WITH YOU. SHOULD ANY SCRIPT PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW THE AUTHOR WILL BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE ANY SCRIPTS (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SCRIPTS TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

The links in this blog may lead to third-party Web sites. IntellPartners provides third-party resources to help you find other services and/or technical support resources. Information at these sites may change without notice. IntellPartners is not responsible for the content at any third-party Web sites and does not guarantee the accuracy of third-party information.