Developing for Dynamics GP

by David Musgrave (Perth, WA, Australia) and the Microsoft Dynamics GP Developer Support Team (Fargo, ND, USA)

How can I identify the parameters of a Procedure or Function?

How can I identify the parameters of a Procedure or Function?

  • Comments 5

David MeegoOne of the great things about Dexterity is that you can develop complex customisations without needing access to the source code.  Even if you have access to source code via the Source Code program, a Dexterity developer never actually changes original source code.

By using triggers before and/or after the original code, it is possible to change the behaviour of the original code or add additional functionality. Because we never changed source code directly, Dexterity customisations can be upgraded between versions of Microsoft Dynamics GP very quickly and often just need testing after upgrading.

Even though you cannot see the core functions and procedures in distributed Dynamics.dic (because the source code has been removed), you can still call (or trigger against) any of the form level or global level functions and procedures as long as you know the name and the parameters.

The same goes for 3rd party dictionaries.  It is possible to call a form or global level function or procedure in a 3rd party dictionary if you know the name and the parameters.  A procedure can be called with the call with name in dictionary command and a function can be called using the execute() function using pass through Dexterity sanScript.  You can also use the Trigger_RegisterXXByName() series of function library commands to register cross dictionary triggers.

Please see the post Cross Dictionary Dexterity Development for more information on working with 3rd party dictionaries.


So how do we get the names and parameters?

The Software Development Kit (SDK) is the best source of information.  The SDK can be installed from the Tools folder of CD 2 of the install CDs or downloaded using the links on the Developer Articles & Links page. Many of the common calls needed by developers are listed in the various Programmer's Interface documents in the SDK.  If the call is provided in this documentation, you will have details of all the parameters and what values should be set for each parameter as well as a description of what the call does.

In Dexterity Test Mode, you can use the Debug menu and Script Logging feature to capture existing core code calling the function or procedure in a script.log file.  The script log shows the values of the parameters passed (except the contents of composite fields or table buffers).  This would still provide a guideline to what information was passed and how many parameters there are. For example:

'Messenger_Status', "CUS", "AARONFIT0001", "PRIMARY", 0, MessengerButton

To find out more information about the call you can look at the parameter documents in the SDK. For example the parameter information for Dynamics.dic can be found in the following documents:

  • Dyn80param.txt (from v8.00 SDK)
  • CoreParams_900.txt (from v9.00 SDK)
  • CoreParams_1000.txt (from v10.00 SDK)

Just open the document and search for the function or procedure name and the parameter list will be provided. For example:

------------------------------------------------------------------------
SYSTEM GLOBAL PROCEDURE:  Messenger_Status
------------------------------------------------------------------------
in                       string                   sMasterType;
in                       string                   sMasterID;
in                       string                   sAddressCode;
inout                    anonymous field          IMVS;
optional inout           anonymous field          IMButton;

You can also use the Script Logging in runtime mode to get logs of 3rd party dictionary calls.  You can use the Support Debugging Tool or manually add the Dex.ini settings as described in the following Knowledge Base (KB) article:

Using the Script Debugger in runtime (KB 850487) Secure Link

Using the script logging facility built into Dexterity along with the SDK it is possible to obtain the parameters for almost all functions and procedures in the system.  If the dictionary comes from an ISV (Independent Software Vendor) and not Microsoft, you can contact their support team and they would normally be willing to provide the parameter list.  If it is a Microsoft dictionary which is not included in the SDK documentation, you can ask on the newsgroups or open a support incident to ask for the parameter list.

I hope you you find this information useful.

David

  • Many times on the newsgroups, I see questions from developers new to Microsoft Dynamics GP along the

  • Posting from the Dynamics GP Blogster

    http://dynamicsgpblogster.blogspot.com/2009/01/developing-for-dynamics-gp-weekly_24.html

  • Dave,

    How do I declare the call to a Procedure from a Go To in SmartListBuilder?

    I'd like to see if I can have my own SmartList where the right window, Sales Transaction Entry or Sales Transaction Inquiry Zoom, will open depending on the document status.

    Any ideas?

    Thanks,

    Hector

  • I want to print an amount in a third currency other the functional and originating currency in an SOP document.  Fro this purpose I want to fetch the exchange rate of that currency in report writer. Is there any function I can use for this purpose? I found a function (rw_GetExchageRate) but i have no idea of it parameters.

    Please help/guide someone had come across the same issue before.

  • Hi Mahesh

    rw_GetExchangeRate() is only used for MC payables transactions.  Maybe on of the following can help you:

    RW_ConvertToReportingCurrency()

    in 'Print Currency In' nPrintCurrencyIn;

    in currency cyFunctionalAmt;

    in 'Rate Calculation Method' nRateCalcMethod;

    in 'Reporting Exchange Rate' cyReptExchRate;

    nPrintCurrencyIn = REPORTING (value of 1).

    rw_MCCalcCurrencyViewAmount()

    in integer nCurrencyView;

    in currency cyOrigCurrencyAmount;

    in integer nRateCalcMthd;

    in 'Exchange Rate' cyExchRate;

    in 'Exchange Rate' cyDenomExchRate;

    in 'Currency ID' sCurrencyID;

    If you need more help, can I suggest asking on the newsgroups so others can help and also others can benefit from the answer.  There are links for newsgroups and forums on the right hand side of the blog page blogs.msdn.com/DevelopingForDynamicsGP.  The other option is to open a support incident.

    Note this post does explain where to find the parameter lists.

    David

Page 1 of 1 (5 items)
Comments Information

PLEASE READ BEFORE POSTING

Please only post comments relating to the topic of this page.

If you wish to ask a technical question, please use the links in the links section (scroll down, on right hand side) to ask on the Newsgroups or Forums. If you ask on the Newsgroups or Forums, others in the community can respond and the answers are available for everyone in the future.

Leave a Comment
  • Please add 1 and 8 and type the answer here:
  • Post