another blog

Icon

About Microsoft Dynamics GP :-)

Getting the current open window in .net GP Add In

There are many ways of getting information of active window in GP, but it changes according to the developing tool we are working on.

1.Dexterity.(the best tool 🙂 <3)

2.VS Tools For Dynamics GP

2.Continuum API (and so adding reference of this API in Custom Visual Studio AddIn.)

1.Dexterity provide various function, with the help of the combination of those functions we can find the active window information. Or we can also use COM objects to do the same.All we need to do is to add a COM Type Library and then use the objects and properties.

2.VS Tools , with available dynamics objects and execute sanscript function, it’s far more easier to find active window in VSTools for Dynamics GP project then in standard visual studio application.

3.Standard Visual Studio App, even can give us clue of active window by adding continuum API reference to it. Below is a code I just tried with Visual Studio 2013.

Public Class Form1

Public GPApp As Dynamics.Application
Dim s1, s2, s3, s4 As String

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

GPApp = GetObject(“”, “Dynamics.Application”)
GPApp.GetDexActiveWindow(s1, s2, s3, s4)
MsgBox(s1)
MsgBox(s2)
End Sub
End Class

Details about this of GetDexActiveWindow() method is below.The GetDexActiveWindow() method returns 4 string parameters that tell us the Form technical name,window technical name, dictionary name and window title. Shown below is an example of this code:

Dim result As Boolean
Dim mystr1 As String
Dim mystr2 As String
Dim mystr3 As String
Dim mystr4 As String

result = eEnterpriseApp.GetDexActiveWindow(mystr1, mystr2, mystr3, mystr4)

MsgBox (“Form Name = ” & mystr1)
MsgBox (“Window Technical Name = ” & mystr2)
MsgBox (“Dictionary Name = ” & mystr3)
MsgBox (“Window Title = ” & mystr4)

 

classb

out put

There are other cool ways we can use to find active window name, title. I have used one by using batch file and command prompt commands from within Dexterity to find the active window. Good programmer use windows API to do the same. 😉  And Dexterity experts also trigger the application to provide them what they are looking for. 😀

below is the source and inspiration for this post.

inspiration

Filed under: Dexterity Development, Dynamics GP, dynamics-gp

Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Enter your email address to follow this blog and receive notifications of new posts by email.

almas

Error: Please make sure the Twitter account is public.

Blog Stats

  • 7,879 hits

RSS dynamics-gp

  • VSTools and database triggers.
    In SanScript coding we have database triggers, Below is a detail of what database triggers are as explained in dexterity manuals. Database triggers Database triggers are activated by successful table operations, such as a record begin read, saved, or deleted. The procedure that runs in response to a database trigger has access to the same […]
    Almas
  • Getting the current active window in Dexterity.
    Using dexterity there is not a direct way of getting current active window information, but with set of available GP functions and triggers can make this task happen. Below I am sharing a trigger and function which can tell the active window name. Below code needs to be changed according to the needs of developer, […]
    Almas
  • Hints and Tips… On going Post
    This is on going post and points will be added from time to time. 🙂 .. with Field Level Security we can not restrict document access on Sales transaction entry Window. Means we can not make user to choose only ‘Invoices’ in SOP Type drop down. .. we can not add custom table in table […]
    Almas
  • Reversing the sort order of Receivable Transaction Inquiry – Customer by Document Date
    Last few months we got more request on changing sort orders of Inquiry windows and lookups and to cover them all in a one place I have been working on a small project which will provide a simple sorting without much effort. In Dynamics Community there was a post having similar situation, I have already […]
    Almas
  • Getting the current open window in .net GP Add In
    There are many ways of getting information of active window in GP, but it changes according to the developing tool we are working on. 1.Dexterity.(the best tool 🙂
    Almas
  • Not all RW_Function are meant for reports.
    There are lots of RW functions available in a report writer Calculated Field Definition window and almost all of them are so handy while working on report writer, but it is a matter of fact that some of them are not actually meant for report writer. Usually RW functions are associated with report writer and […]
    Almas
  • Dexterity Can Wait and Respond.
    https://evspakistan.wordpress.com/microsoft-dexterity-can-wait-respond/Filed under: Can i, Dexterity Development, Dynamics GP, dynamics-gp, Uncategorized Tagged: Delay, dexterity, Wait
    Almas
  • Cross Dictionary Development.
    https://evspakistan.wordpress.com/cross-dictionary-development/    Filed under: Dexterity Development, Dexterity Triggers, Dynamics GP, dynamics-gp, Uncategorized
    Almas
  • Calling Sales Document Numbers Lookup
    Often developers need to open available lookup on their custom form from dynamics GP.Sales Document Number lookup is a very common and much used lookup and every dynamics technical person needs to call it in once (or more) in their lifetime. 🙂 Dynamics GP SDK provide a prototype of coding on how to open various […]
    Almas
  • This datatype name is already in use.
    This datatype name is already in use.
    Almas
Coding Notes

Code, News, Tech & Stuff

Dynamics GP Builders & Reporting

How to use MS Dynamics SmartList Builder, Excel Report Builder and other Reporting tools to get the data and analysis you need.

%d bloggers like this: