another blog

Icon

About Microsoft Dynamics GP :-)

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 lookup. Although it has given a much detailed list of parameters, the drawback is that we can not apply filter on the GP traditional lookup.

As with SDK prototype, desired document type can be focused but we can not make a lookup to fill only specific document type.

This leads developers to design 3rd party windows and then calling them.

SDK Prototype:

open form SOP_Document_Lookup return to ‘(L) DummySOPReturn’;
call OPEN of form SOP_Document_Lookup,
‘Sort By’, {initial sort unless overridden by starting seed of below parameters}
l_display, {documents to display}
work_or_history, {initially display WORK or HISTORY documents}
GB_locked, {lock the work/history radio group}
iSOPType, {seed value for SOP Type}
sSOPNumber, {seed value for SOP Number}
sCustomerNumber, {seed value for Customer Number}
sBatchNumber, {seed Number of Batch Number, Work Documents only}
sTRXSource, {seed Audit Trail code, History Documents only}
dDocDate, {seed Document Date}
iMasterNumber; {seed Master Number value}

In this SDK scrip calling example there are two optional parameters not used, but mentioned in parameters description which you can get detail from parameter list.

  • IN12 optional OpenedFromTrx parameter used by the SmartList product
  • IN13 optional RestrictSOPType parameter that will restrict the lookup to a specific SOP Type.

By supplying these two parameters we can filter lookup with desired sales type and can avoid designing of a whole new custom lookup form.Below is a code of calling lookup, I am just giving the idea of passing parameter and so hard-coded the values.

open form SOP_Document_Lookup return to ‘(L) FromDocNumb’;
call OPEN of form SOP_Document_Lookup,
4,
0,
WORK,
1,
2,
“”,
“”,
“”,
“”,
l_date,
0,
true,
soptype;

The last  parameter is telling that you are about to filter the lookup with the selected type on custom form. This will work find if your alternate smartlist lookup is marked, but if traditional GP lookup is marked, it will not filter the document types.

 

SOPLOOKUPFIlter

The hard thing for many developers is that they can not test the code in debug mode\test mode, as the lookup mark is in another dictionary and gives a message “Cannot access this form because the dictionary containing it is not loaded.”, so to test code functionality, developer have to create a chunk and then add a code in GP.

 

Filed under: Dexterity Development, Dynamics GP, Dynamics GP Lookups, 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: Twitter did not respond. Please wait a few minutes and refresh this page.

Blog Stats

  • 7,671 hits

RSS dynamics-gp

  • 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
  • Adding Customer Inactive checkbox to National Accounts Form.
    RE: Adding Customer Inactive check box to National Accounts form. https://community.dynamics.com/gp/f/32/p/134427/292770.aspx#292770 To run this code you need to add a reference. Mark a reference to a Microsoft Active X Data Object Library in the VBA editor.        1. Open up the VBA editor and go to Tools | References.2. Scroll down until you see the […] […]
    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: