Developing for Dynamics GP

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

Customizations to the Cash Receipts (RM_Cash_Receipts) window failing for GP 2010

Customizations to the Cash Receipts (RM_Cash_Receipts) window failing for GP 2010

  • Comments 4

David Meego - Click for blog homepageI have had a number of support cases and newsgroup posts recently about Customization to the Cash Receipts (RM_Cash_Receipts) window failing to work for Microsoft Dynamics GP 2010 when they worked for previous versions.

The problem is that the code appears to work, but the Document Number field is never populated and always returns an empty value.

The reason is that changes to the RM_Cash_Receipts window for GP 2010 have moved the 'Document Number' field to a hidden field beneath the window and replaced it with a local '(L) STR17DocNumber' field.  It is this new local field that must now be used to obtain the Receipt number of the transaction from the window.

This change was made so that recurring transactions could add a 3 digit suffix 001, 002, etc. onto the 17 character document number and that would use the maximum 20 characters in the table.

Below are some steps for getting your customization working again:

For Dexterity

Replace all references to 'Document Number' of window RM_Cash_Receipts of form RM_Cash_Receipts with '(L) STR17DocNumber' of window RM_Cash_Receipts of form RM_Cash_Receipts.

If you have a single customization which has source code shared across multiple versions of Microsoft Dynamics GP, use pre-compiler directives with a constant to conditionally compile your code:

  1. Create a constant with the product version in it.  For example: MBS_PROD_VER_MAJ with the value being the major version number eg. 10, 11.
     
  2. Include both sets of code referencing 'Document Number' and '(L) STR17DocNumber' and surround them with pre-compiler directives.
     
    Note: the hash # symbol must be the first character on a line with no white space (tabs or spaces) in front of it.

#if MBS_PROD_VER_MAJ >= 11
    { GP 2010 code here referencing '(L) STR17DocNumber' field }
#else
    { Previous code here referencing 'Document Number' field }
#end if

  

For Visual Basic for Applications (VBA)

To fix a VBA customization, we need to make sure that the new '(L) STR17DocNumber' field is being referenced rather than the old 'Document Number' field.  The easiest way to confirm this is to add the window and fields to VBA again.

  1. If the window has been modified, open the window with Modifier and confirm that the field for Receipt number is the new '(L) STR17DocNumber' field. Selecting the field will show its name in the Properties window, or you can select Show Field Names from the Layout menu.  If the field has not been updated, you will need to delete the modified window and remake your changes to the new version of the window.
     
  2. Once you have confirmed the window has the new field, go to the Visual Basic Editor and Select the CashReceiptEntry window by double clicking on it. Then click on the drop down list at the top of the Properties window on the left hand side.  Make a note of the fields listed or take a screenshot.
     
  3. Click in the script editor and use Ctrl-A to select all and Ctrl-C to copy to the clipboard. Paste the code into Notepad.exe as a backup, but also leave on clipboard by not cutting or copying anything else.
     
  4. Use Tools >> Customize menu to Remove the window from Visual Basic.
     
  5. Then add the window back to Visual Basic and add the fields noted in step 2 back to Visual Basic.
     
  6. Go back to the Visual Basic Editor and use the Properties drop down list to confirm all the fields have been added.
     
  7. Paste the code back into the script editor, and select Debug >> Compile to make sure the code compiles. It will give errors if a field was missed in step 5.
     
  8. Once the code is compiled, use the Save Button to save the code and then test to see if it is now working as desired.

 

Hope this helps.

David

25-Aug-2011: Added information on why the change was made in GP 2010.

  • Posting from Mark Polino at DynamicAccounting.net

    msdynamicsgp.blogspot.com/.../customizations-to-cash-receipts.html

  • I've had this similar question in support cases as well. But sometimes it takes a different flavor--WHY would Dynamics GP reduce the number of characters allowed (keyable) for this field from 20 down to 17?

    The reason is that now in Dynamics GP 2010, recurring cash receipts batches can now be entered. We reduced the editable characters in that field in order to make space for the 001, 002, 003 value at the end, to denote which recurrence of the transaction you are viewing.

  • Thanks Tammy,

    I was wondering why this change was made.

    David

  • Hi David,

    I followed your steps and I still get a blank value for the Cash Receipt Number.

    Any other suggestions?

    Thanks so much.

    Brent

Page 1 of 1 (4 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 8 and 8 and type the answer here:
  • Post