Accessing Internet Information from Report Writer


David Meego - Click for blog homepageLast week, I had a call from a partner asking how could they access data stored on the Internet Information window.

This is the window opened with the little italic i symbol next to the Address ID field for Company, Customer, Employee and Vendor Addresses as well as next to Employee ID and Salesperson ID fields.

The data for this window is stored in the coINetAddrs (SY01200) table and has eight (8) user defined fields and a text field. For Microsoft Dynamics GP 2010, the Email To, Email Cc, Email Bcc and Messenger Address fields were added to the window.  The prompts for the user defined fields are defined in the Company Setup window (Tools >> Setup >> Company >> Company >> Internet User Defined) and are stored in the coINetPrompts (SY04800) table.

 
Microsoft Dynamics GP 2010: Internet Information window

The usual method to add data onto a report is to define a relationship to the table in question and then add it to the report.  However, as the primary key for the coINetAddrs (SY01200) table starts with a Master Type field which is a 3 character constant value which represents the type of data being stored. As it is not possible to add a constant value when defining a table relationship, it is not possible to attach this table to a report. 

The table below shows the values for the Master Type field:

Entity  Constant  Code 
Company  CO_INETADDRS_COMPANY CMP
Customer  CO_INETADDRS_CUSTOMER CUS
Employee  CO_INETADDRS_EMPLOYEE EMP
Item  CO_INETADDRS_ITEM ITM
Salesperson  CO_INETADDRS_SALESPERSON SLP
Vendor  CO_INETADDRS_VENDOR VEN

So, to allow this data to be accessed, I added three Report Writer user defined functions (System series) to version 7.0 and later of Microsoft Dynamics GP.  Below are SDK entries from the RW_Func.doc document:


RW_GetInternetInfo
 
Module: 
System Manager

Series:
System      

Script type: 
Global function 

Form (If a form global): 

Category:  
Data Retrieval

Description:  
Returns Additional Internet Information fields 1 to 8 for the specified Master Type, Master ID and optional Address ID.

IN_MasterType should use the following values:-
 CMP = CO_INETADDRS_COMPANY
 VEN = CO_INETADDRS_VENDOR
 CUS = CO_INETADDRS_CUSTOMER
 EMP = CO_INETADDRS_EMPLOYEE
 ITM = CO_INETADDRS_ITEM
 SLP = CO_INETADDRS_SALESPERSON

IN_field must have a value between 1 and 8.

Note: Microsoft Dynamics GP 2013 allows an IN_field value of 9 to retrieve the Messenger Address.

Prerequisites:  
none

Parameters:  
in string IN_MasterType.
in string IN_MasterID.
in string IN_AddressID.
in integer IN_field.

Return Value:
function returns string OUT_string.


RW_GetInternetPrompt
 
Module: 
System Manager

Series:
System      

Script type: 
Global function 

Form (If a form global): 

Category:  
Data Retrieval

Description:  
Returns Additional Internet Information prompts 1 to 8 for the current company.

IN_field must have a value between 1 and 8.

Prerequisites:  
none

Parameters:  
in integer IN_field.

Return Value:
function returns string OUT_string.


RW_GetInternetText
 
Module: 
System Manager

Series:
System      

Script type: 
Global function 

Form (If a form global): 

Category:  
Data Retrieval

Description:  
Returns Additional Internet Information Text field as strings of given length for the specified Master Type, Master ID and optional AddressID.

IN_MasterType should use the following values:-
 CMP = CO_INETADDRS_COMPANY
 VEN = CO_INETADDRS_VENDOR
 CUS = CO_INETADDRS_CUSTOMER
 EMP = CO_INETADDRS_EMPLOYEE
 ITM = CO_INETADDRS_ITEM
 SLP = CO_INETADDRS_SALESPERSON

Note: Microsoft Dynamics GP 2013 adds an optional IN_field parameter, which can use values of 10, 11 or 12 to retrieve the to, cc and bcc email addresses. While the parameter is optional when called from Dexterity it is required when called from the Report Writer to avoid an Error in Equation message. Set it to 0 to retrieve the Text field contents.

Prerequisites:  
none

Parameters:  
in string IN_MasterType. { MasterType Code }
in string IN_MasterID.  { Master ID }
in string IN_AddressID.  { Optional Address ID }
in integer IN_characters. { Number of Characters per Line }
in integer IN_line.  { Line Number to Return }
optional in integer IN_field; {Text field desired, 10(to), 11(cc) 12(bcc)}   — GP 2013 only

Return Value:
function returns string OUT_string.


To use these Report Writer functions you need to create calculated fields using the User Defined functions in the System Series.  Below are examples of all 3 functions:

An example of using the RW_GetInternetPrompt() function return the text for the first prompt is:

Name: (c) Internet Information Prompt 1
Result Type: String
Expression Type: Calculated
Calculated: FUNCTION_SCRIPT(RW_GetInternetPrompt  1)

 

An example of using the RW_GetInternetInfo() function return the value for the first field for the primary vendor address is:

Name: (c) Internet Information Value 1
Result Type: String
Expression Type: Calculated
Calculated: FUNCTION_SCRIPT(RW_GetInternetInfo “VEN”  PM_Vendor_MSTR.Vendor ID  PM_Vendor_MSTR.Vendor Address Code – Primary  1)

 

Finally, an example of using the RW_GetInternetText() function to return 3 lines of 80 characters of the Text field for the same primary vendor address into 3 string calculated fields is:

Name: (c) Internet Information Text 1  
Result Type: String
Expression Type: Calculated
Calculated: FUNCTION_SCRIPT(RW_GetInternetText  “VEN” PM_Vendor_MSTR.Vendor ID PM_Vendor_MSTR.Vendor Address Code – Primary  80  1)

 

Name: (c) Internet Information Text 2
Result Type: String
Expression Type: Calculated
Calculated: FUNCTION_SCRIPT(RW_GetInternetText “VEN” PM_Vendor_MSTR.Vendor ID PM_Vendor_MSTR.Vendor Address Code – Primary 80 2)

 

Name: (c) Internet Information Text 3
Result Type: String
Expression Type: Calculated
Calculated: FUNCTION_SCRIPT(RW_GetInternetText “VEN” PM_Vendor_MSTR.Vendor ID PM_Vendor_MSTR.Vendor Address Code – Primary 80 3)

 

With the use of these 3 functions you can pull the data from the Internet Information window onto your reports simply and easily. 

Note: At this stage the RW_GetInternetInfo() Report Writer does not support returning of the three Email Address and the Messenger Address fields. This issue has been logged as Problem Report 62880, if you want this functionality, please log a support case and reference this bug number.

For more information see the post: Using the built-in Report Writer Functions 

David

25-Oct-2012: Microsoft Dynamics GP 2013 fixes Problem Report 62880. The RW_GetInternetInfo() function accepts field number 9 for the Messenger Address and RW_GetInternetText() adds a field number parameter which accepts 10, 11 and 12 for the three email addresses. See Notes above.

Comments (12)

  1. David Musgrave says:

    Posting from Mark Polino at DynamicAccounting.net

    msdynamicsgp.blogspot.com/…/accessing-internet-information-from.html

  2. Maria says:

    Hi David,

    Thank you for the valuable information you are sharing. I have used your example above and was able to print customer e-mail address. I would like to print the sales person email address as well but I can not figure our the master table to use. I have linked the RM Sales Person table to my report but there is no address code field available.  if possible to give me an example will be much appreciated.

    Thanks

    Maria

  3. Heather Roggeveen says:

    Hi David

    This may be a really silly question – but I can't see the solution – how do you get this part of the parameter:

    PM_Vendor_MSTR.Vendor Address Code – Primary

    I can add the PM_Vendor_MSTR.Vendor Address Code part of it, but not the rest

    Cheers

    Heather

  4. David Musgrave says:

    Hi Heather

    When working with Vendor Internet Information:-

    The first parameter is the three letter code as a string constant: "VEN"

    The second parameter is the Vendor ID.

    The third parameter is the Address ID for that Vendor. There are 5 address IDs available on the Vendor Master table for Primary, Remit To and Ship From, Purchase and 1099, or you can use an ID from another table, such as the transaction tables.

    Hope this helps.

    David

  5. Lay Chin says:

    Hi David

    This is extremely useful information.  I had been using this for the additional information for inventory item.  

    The information is pulled in the SOP forms.

    This works fine for GP10 and GP2010.  I am having issues now with the SOP forms showing an equation error for the calculated field in GP2013.  

    Noted a blog on which Rubal indicated something close to this, except it is for CMP and not ITM for example before upgrade FUNCTION_SCRIPT(RW_GetInternetText “CMP” sInetID sAddressCode 50 1 ) to after upgrade FUNCTION_SCRIPT(RW_GetInternetText “CMP” sInetID sAddressCode 50 1 0 )

    Is there a change in the table structure?

    Any valuable information for us?

    Appreciate your help.

    Thank you.

  6. Hi Lay Chin

    There is an extra parameter which can tell the function return the email address information.

    See the highlighted bits in this article in red for the changes that were made.

    David

  7. Lay Chin says:

    Hi David

    Thank you, I finally found the extra parameter at the end.  

    Appreciate and thank you very much for your help.

    Best Regards

    Lay Chin

  8. Donald Wisch says:

    Hi David,

    I am trying to get the function RW_GetInternetInfo to work so that I can pull internet information per company but it does not work. I cannot figure out what I am doing wrong.

    “‘RW_GetInternetInfo'( \”CMP\” globals.’Intercompany ID’\”PRIMARY\” 1 ) ”

    When I preview the report, I get an error “Error in equation ‘CompanyEmail1’.

    Any idea what would be causing this?

    Much thanks,
    Donald Wisch

    1. Hi Donald

      Lucky I still monitor comments on my old blog. 😉

      I was able to replicate the error you were having. This is just the report writer being weird.

      The solution is to create a string calculated field with the expression Global.’Intercompany ID’ and use that in the RW function.

      Hope that helps.

      David

      1. Donald Wisch says:

        Grateful that you still monitor this blog David! Thank you for your advice and all that you do for the GP community… have a great day 🙂

        1. Donald Wisch says:

          That worked Dave… thank you so very much!!!

Skip to main content