I’ve created a SmartList Builder SmartList that shows a list of posted Payables Transactions from the PM Transaction OPEN File in Dynamics GP. While I can use the built-in GoTos to open various GP windows, I need to create a GoTo that opens the selected record in the Edit Payables Transaction Window and am unable to find a way to do this. Is it possible?
When adding GoTos for your SmartList Builder created SmartList, it is always best to use a built-in GoTo that is out of the box if possible. The best place to see if one exists is to look in the Built-In goto for the GP SmartList that is similar to what your custom SmartList does as Microsoft has created the most common ones already that you could just use.
If you’d rather watch a video demonstrating this, click below.
However, in this case, the “Edit Payables Transaction” window in GP is not among the pre-built options and we would have to create it ourselves. The “Open Form” GoTo type is the only option that end users have available to create if there is not one already built-in and available.
Here we give the GoTo a name by setting Description and picking the product and series and the name of the window we want to open.
At this point if we were to test this GoTo with our SmartList, the window would open but be empty since we haven’t provided instructions on how to make the window populate.
For an Open Form type of GoTo like this, the idea is to essentially “drive” the user interface as a normal user would interact with the window without using the “lookup buttons” – we’d enter the data into the appropriate fields and let the Dynamics GP code then pull up the record.
It is sometime hard to determine which fields need to be populated as often the fields on the window which SLB will show you are NOT the same as the window prompts are – but usually we can figure them out.
Looking at the target window, the fields that we need are required fields displayed in Red and are the Vendor ID, Document Type, and then the Number field. Because we are going to mimic the user interaction – that would be the same order that we want to set them in our GoTo.
The first one is the Vendor ID and the field is the same in the source file as the window and is easy to discover.
Notice the Task Type is “set a field value and run the field script”. This is almost always what you want to do “and run the field script”. If we just use the “set a field” option, then the Dynamics GP code isn’t executed and the GoTo probably will not work.
The second one for Document Type is similar however we do have to be a little bit careful as the Document Type on the GP UI is a “dropdown list” – values in a dropdown list are integers and not strings. The value of a drop down list is always 1, 2, 3…n regardless of the data displayed.
In this case, that isn’t a problem. Because is report is using a GP Table, the underlying table value is an integer but the SLB code translates it to the proper words to make it easier for the end user but the “integer value” of the record is what is used in the GoTo.
If your SLB report was using a SQL view where the return was a string – Invoice, Credit Memo, etc, we would need another field that was the actual integer from the data for use in the GoTo.
Lastly, we need to fill in the Document Number. In this case, the field is actually (L) Document Number where the (L) stands for “local field”. Oftentimes the field used on GP windows is “(L) Temp Control Number” – GP development used a few different naming conventions when writing the windows so sometimes a little experimentation is in order. But (L) Document Number is the correct field to set.
This is the last task we need to complete so we can save our GoTo and set it as the default GoTo since there is the only one currently.
Testing the GoTo by running our report and double clicking on one of the lines – we can see that the proper record was selected and the GoTo worked without any errors and GP did pull up this Payment properly ready to edit in the desired window.