Developing for Dynamics GP

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

Changing the Phone Number Format

Changing the Phone Number Format

  • Comments 7

David Meego - Click for blog homepageOne of the most common customisations outside of North America is changing the Phone Number Format.  The North American default format of (XXX) XXX-XXXX  Ext. XXXX is not always suitable for other countries.

For example: Australia, Singapore and Malaysia now use a domestic format of a 2 digit area code and a 8 digit phone number: (XX) XXXX XXXX. However, if the default phone formats for these countries were changed to this domestic format, you would not be able to enter international phone numbers.  To compromise, I suggested a combined format of (XXX) XXXX-XXXX Ext. XXX which allows both domestic (2-4-4) and international (3-3-4) numbers to be entered.  This format is now the default format for these countires. To enter phone numbers, you just need to press the space or right arrow to skip the digit not being used. This is discussed in more detail in the following Knowledge Base (KB) article: 

How to enter an Australian domestic telephone number or an international telephone number in Microsoft Dynamics GP 9.0 (KB 920834) Secure Link

So what happens when the default format for your country does not meet your requirements or your country does not have a standardised format.  In these situations you will need to change the format to a different template or possibly "remove" the formatting entirely.  The reason that I put "remove" in quotes is that it is better to replace the format with the appropriate number of X's than to actually remove the format string entirely.

The default keyable length for a phone number is 14, however at the storage length at the Dexterity level is 22, which means that the string can actually be a maximum of 21 characters.  So not only can you change or "remove" the format, you can also increase the length up to 21 characters.

The format and data type used for the Phone 1 and Phone 2 fields are both named Phone_Number. The format and data type used for the Phone 3 field are both named Phone_Number3.  Fax Numbers use the Phone_Number format, but the STR14_FAX data type.

The next sections will discuss how to make changes to various areas of the Microsoft Dynamics GP application. 

Dexterity

You cannot change the phone format using Dexterity. While it is possible to make the changes to your development dictionary, as the format and datatype resources are part of the core Dynamics.dic (with resource IDs less than 22,000), they will not be extracted when you create a chunk file.  This means your changes will work in Dexterity Test mode, but will not be deployed to the runtime environment via a chunk file.

Customization Site License

To make the change in the live application (runtime environment) you will need to use Modifier and Report Writer.  You don't need to be registered for the Modifier, but you will need to be registered for the Customization Site License.  If you are not registered for the Customization Site License, the changes made by the Modifier and stored in the Forms.dic will be ignored. 

Note: The Customization Site License is included with the Modifier & VBA license, but can also be purchased separately.  If you don't at least have the Customization Site License registered, you will be unable to change the phone format.

For a site which is registered for the Customization Site License, but not for the Modifier, the changes will have to be made by the partner by temporarily entering the partner's registration keys.  This is because changes to formats, messages and data types are not transferrable using packages via Customization Maintenance and must be made on the actual system.

Report Writer

To change the Phone format for reports, use the following steps: 

  1. From the application menus, click Microsoft Dynamics GP, click Tools, click Customize, and then click Report Writer.
  2. In the Product list, click Microsoft Dynamics GP, and then click OK.
  3. From the menus click Resources, and then click Data Types.
  4. In the Data Types window, click Phone_Number, and then click Open to open the Data Type Definition window.
  5. Enter the desired Keyable Length field to a maximum 21 characters.
  6. Click OK to confirm the changes.
  7. From the menus click Resources, and then click Formats.
  8. In the Formats window, click Phone_Number, and then click Open to open the Format Definition window.
  9. In the Format Strings area, click the current format string.
  10. Click Remove to remove the old format.
  11. Type the Format String you want. If you want no formatting enter the Keyable Length's worth of X's.
  12. Click Insert to add the new format back.
  13. Click OK to confirm the changes.
  14. Repeat steps 3 through 13. In steps 4 and 8, click Phone_Number3 instead of Phone_Number. For Fax numbers, repeat steps 3 through 6, in step 4, click STR14_FAX instead of Phone_Number.
  15. From the menus click File, and then click Microsoft Dynamics GP to exit Report Writer.

Note: To change the phone formats for windows, see the next section.

Modifier

To change the Phone format for windows, use the following steps:

  1. From the application menus, click Microsoft Dynamics GP, click Tools, click Customize, and then click Modifier.
  2. In the Product list, click Microsoft Dynamics GP, and then click OK.
  3. From the menus click Resources, and then click Data Types.
  4. In the Data Types window, click Phone_Number, and then click Open to open the Data Type Definition window.
  5. Enter the desired Keyable Length field to a maximum 21 characters.
  6. Click OK to confirm the changes.
  7. From the menus click Resources, and then click Formats.
  8. In the Formats window, click Phone_Number, and then click Open to open the Format Definition window.
  9. In the Format Strings area, click the current format string.
  10. Click Remove to remove the old format.
  11. Type the Format String you want. If you want no formatting enter the Keyable Length's worth of X's.
  12. Click Insert to add the new format back.
  13. Click OK to confirm the changes.
  14. Repeat steps 3 through 13. In steps 4 and 8, click Phone_Number3 instead of Phone_Number. For Fax numbers, repeat steps 3 through 6, in step 4, click STR14_FAX instead of Phone_Number.
  15. From the menus click File, and then click Microsoft Dynamics GP to exit Modifier.

Note: To change the phone formats for reports, see the previous section.

SmartLists & the Letter Writing Assistant

Once you have made the changes to the format on the windows and the reports, you might notice that SmartList and the Letter Writing Assistant still use the old format.  This is because they have to programmatically format the phone numbers and actually use a message resource to describe what the format looks like. This is because it is not possible to actually read the format from Dexterity code.

To change the Phone format for SmartList and the Letter Writing Assistant, use the following steps:

  1. From the application menus, click Microsoft Dynamics GP, click Tools, click Customize, and then click Modifier.
  2. In the Product list, click Microsoft Dynamics GP, and then click OK.
  3. From the menus click Resources, and then click Messages.
  4. In the Message ID box, type 6055 and then press tab.
  5. In the Message box, type the same format entered previously, and then click Save.
  6. Close the Message window with the X button.
  7. From the menus click File, and then click Microsoft Dynamics GP to exit Modifier.

For more information see the following Knowledge Base (KB) article:

How to change the telephone format for SmartList and for Letter Writing Assistant in Microsoft Dynamics GP by using Modifier with Visual Basic for Applications (KB 921632) Secure Link

I hope this information is helpful. 

David

  • This is very important post for me, as most of the clients I have worked with wanted a Phone Format Change. The most important part of this post for me is Smartlist & LWA. I had never thought I could change the format in Smartlist also, falsely believing that Smartlist renders based on it's own field and format.

    Thanks for changing that perception and teaching on how to change the format.

    Thanks for this post, I can win over several clients' smiles now.

    Vaidy

  • Posting from Mark Polino at DynamicAccounting.net

    msdynamicsgp.blogspot.com/.../changing-phone-number-format-in.html

  • Hi David,

    If i change the phone format on the server, does i need to do same thing for the client too?

  • Hi Shah

    The same change needs to be made at each workstation. If you have the same modified forms and reports on all workstations (recommended), you can just copy the forms.dic and reports.dic files from an already updated workstation.

    Have a look at this article for a method of rolling out changes to all workstations:

    blogs.msdn.com/.../automating-distribution-of-customisations-part-1.aspx

    David

  • Thanks David, the use of SmartLists is helpful.

  • Hi David,

    Thanks for the info.  Currently I am exporting all of my form & report modifications to packages and saving them in TFS so I can track changes.  Is there anyway to export/import the modifications done to the data types so I can track them too?

    Thanks!

    John

  • Hi John

    My recommendation for base resource changes (formats, strings, messages, etc.) is to record a macro of the steps so it can be easily re-applied.

    You can store the macro files in TFS.

    David

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