Tech Tuesday: Extending a SmartList Builder GoTo using Extender Enterprise Scripting
A user had a question today about creating a GoTo using SmartList Builder.
In the SmartList, they were building a Security report based on the SY60100 table for the User/Company access.
That was all working successfully.
Next they wanted to create a GoTo that would open the User Company Access window.
That was of course, very easy. We were able to create an Open Form GoTo named “User Access Setup”
…and I think he was happy with that result.
But always pushing the boundaries, I thought it would be more interesting if we could pull the selected user from SmartList and then select that ID in the GP UI so that our user does not have to do this manually.
Thinking about what we would need to do for this:
- Find the selected line in SmartList
- Determine which column IS the user id in SmartList
- Find the data for that column in SmartList
- In the User Company Access window, find that user in the Users list (which also has other information on the line we have to exclude)
- Make GP select that user and fill the Company Access list for the selected user
While SmartList Builder can make useful GoTos, it isn’t going to handle this as we can only set fields to specific values. And we won’t be able to read the SmartList ListView control in any case.
Next thought was using DrillDown Builder. But again we have the same limitations as SLB – we can’t find our value or parse the fields on the UI.
Now the “right” answer to this question is probably to use the SLB SDK to make a 3rd party cnk file to create a custom Execute Procedure that we can run natively from within SmartList Builder. This custom GoTo would act like the ones already included out of the box.
However you would need someone with good Dexterity skills and you will end up with a small customization in the end that you would have to maintain.
But I wanted to see if I could do it with our good friend Extender Enterprise.
In the end, the answer is “Yes, I can use Extender Enterprise to do this”.
What we can do is create an Extender Action that will run after the selects the GoTo item that we created with SmartList Builder.
Because now we can write native Dexterity, we can now do the steps 1-5 as noted above.
The first thing we need to do is go to the Extender main window and create a new action.
Knowing that Change field actions run after the original code, we then add a new item to this Action.
So select the Add dropdown and choose Run Dynamics GP script.
I named this new action “User Access Setup – GoTo” but the name doesn’t really matter. I just like naming this relevant to what their purpose is.
Notice too that this is running in the SmartList Product context. We have our choice with this one because we need to get the values from the SmartList product but then have to set field information on a window in the Dynamics GP product. So no matter which way we go – we’ll have to run pass through sanScript against SmartList or Dynamics GP.
I’ll have to admit, the Dexterity code is somewhat complicated and running the pass-thru sanScript doesn’t make it easier to read and understand. Even with 15 years of full time Dexterity experience under my belt, it took me a few hours to make this work correctly.
I won’t go through all of the code itself as it is well commented and should give you an idea what each piece does. Having a good amount of experience of Dexterity would also be helpful.
In the screenshot, we can see the User Access Setup window opened from the line I double clicked on with the default GoTo.
Without the Extender Action we created, the SLB GoTo would have opened the window but then no user would be selected. The same result as if the user opens this window from the GP menu.
But with the new Action, we notice that I have the ‘sa’ user selected in SmartList and that it is the same user selected in the User Access Setup window.
I’ve included a zip file here with the SmartList Builder 2013 and Extender 2013 solutions to this blog article so you can download them to user and learn from.
Integrate & Automate without Any Code.
SmartList Data has Never Been Faster.
The Easiest Way to Report on GP Data.
Leave a Comment