My company updated our older version of Extender to Extender 18.3+ and found that the Extender Prompts have changed. The prompts used to display fully but now the prompt is shorter and they no longer fit fully in that space. Is there a solution to this?
With Extender 18.3 release, the Extender Windows was expanded from one column of 15 fields to two columns of 15 fields.
If you’d rather watch a video explaining this, click below.
The Extender window was widened a bit to support the new column of fields – however the prompts were also resized to help fit but do end up smaller than in previous versions and so the prompt could be cut off due to that reduction as we see in the example below.
Looking at this Extender test window – there are two prompts highlighted that appear to be cut off on Extender 18.3+. The red line was added to show about what size the Extender window used to be in the previous versions. In this example, there are no fields in the second column to display as the user would have just upgraded.
From a “Is there a solution to this issue” perspective, there is if you are using Extender Enterprise. With Extender Enterprise you can write Dexterity scripts to do really anything we would like – in this case resize the prompt fields and move the fields to fit better on the new Extender window that is displayed.
By creating a new Action for this Extender Window on the “Before Open” event, we can add a new Dynamics GP Script (which is Dexterity).
We can see the new Action and Event Type of “Open window”. We give the action a new name and enter the code from below.
local integer x; local integer iH, iV, offset; {change this to whatever size you need} offset = 100; {loop through the first column 15 fields and resize the prompts and move field over by offset value|} for x = 1 to 15 do {all the prompts} Field_GetSize('User Defined Prompts'[x] of window 'User Defined Window' of form <#FORM_NAME#>, iH, iV); resize field 'User Defined Prompts'[x] of window 'User Defined Window' of form <#FORM_NAME#> to iH + offset, -1; {all the short strings} Field_GetPosition('User Defined Short String'[x] of window 'User Defined Window' of form <#FORM_NAME#>, iH, iV); move field 'User Defined Short String'[x] of window 'User Defined Window' of form <#FORM_NAME#> to iH + offset, -1; {all the Numbers} Field_GetPosition('User Defined Integer'[x] of window 'User Defined Window' of form <#FORM_NAME#>, iH, iV); move field 'User Defined Integer'[x] of window 'User Defined Window' of form <#FORM_NAME#> to iH + offset, -1; {all the Lists} Field_GetPosition('User Defined List'[x] of window 'User Defined Window' of form <#FORM_NAME#>, iH, iV); move field 'User Defined List'[x] of window 'User Defined Window' of form <#FORM_NAME#> to iH + offset, -1; {all the Dates} Field_GetPosition('User Defined Dates'[x] of window 'User Defined Window' of form <#FORM_NAME#>, iH, iV); move field 'User Defined Dates'[x] of window 'User Defined Window' of form <#FORM_NAME#> to iH + offset, -1; end for;
In this Dynamics GP Script which is written in Dexterity – we declare a “for loop” from 1 to 15. That is the array fields to represent Field 1, Field2, Field 3, etc. The fields on the Extender window are array elements 1 to 15 in the first column and 16 to 30 in the second column. We only need to address the first 15 fields in this example.
We also declare a variable “offset” set to 100 pixels – you would possibly need to make yours larger or smaller so that the specific prompts display nicely.
All of the “Prompts” are called ‘User Defined Prompt’ in the script.
Once those are resized to the current size + the offset, we then need to move the data fields.
To do that, the Field_GetPosition() is used to find the field position and then the data field itself is moved by that same offset. There are four fields “types” that are moved to cover the different types of example data displayed – short strings, integers, drop lists, and dates.
You might have to adjust the code to handle the different types of data in your Extender window but this solved the issue for this specific customer. We can see that the prompts are all extended to handle the length of the two largest ones and all of the data fields are moved over to align properly with the end of the prompts.
You can download the example here with the Dexterity in the links below.