Saturday, July 12, 2008

How to create a Go To link to the Apply Sales Document window in SmartList Builder

A few days aback, my buddy Jim Harris at TurboChef was having an issue with creating a Go To in SLB that would link open credits and return documents displayed in SmartList to the Apply Sales Documents window in GP where he could effectively apply documents that had not been applied to invoices, etc.

I thought, how complicated could that be? You open SLB, you setup your SmartList fields then, setup your restrictions for RM Document Type-All equal or greater than 7, and add the Go To by matching the Customer Number field on the window to the Customer Number in the RM Open Table, the Document Type on the window with the RM Document Type-All field in the table, and the Document Number in the window withe the Document Number in the table, a few clicks to close and save, build and... not so quick!

At first the Apply Sales Document window filled in the Customer Number and Document Number, but screamed at the Document Type field. I figured, my restriction was wrong, so I went back in and check on the restrictions, reviewed the SQL check on my Go To fields to make sure I was matching the values and running the field scripts, a few clicks to close and save, build and... not so quick!

I got the same result as before and was starting to wonder now if I had had a long day and was not thinking straight. So I went to the kitchen, got some coffee and went back to work on the problem.

After a few hit-and-miss attempts the light bulb went off! Drop-down lists are enumerations of the items listed in them! In the case of the Apply Sales Document window, 1 - Credit Memo, 2 - Returns, 3 - Payments, which do not correspond to the actual document types in RM (7 -- Credit Memo, 8 -- Returns and 9 -- Payments).

This meant that I would need to create a calculated field that would pickup the RM Document Type-All value from the RM Open table and translate it into the corresponding enumaration in the Drop-Down list in the Apply Sales Document window. The resulting calculation looked something like this:

case {RM Open File:RM Document Type-All} when 7 then 1 when 8 then 2 when 9 then 3 end

That's correct! It looks and behaves just like the CASE...END statement in SQL Server!

This now meant that in the Go To window, I would have to reference my calculated field instead of the RM Document Type-All field when matching the Document Type value.

From this point on a few clicks to close and save, build and... Voila!

Until next post!

MG.-
Mariano Gomez, MIS, MVP, MCP, PMP
Maximum Global Business, LLC
http://www.maximumglobalbusiness.com/

No comments: