Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Report Writer Script Function Problem

(0) ShareShare
ReportReport
Posted on by

Hi all,

I started working with an old version of great plains (9.0) two days ago, I am completely new to the program so please bear with me.

I am trying to modify a report, specifically the Bill To Address lines and I am using the rw_SlectAddrLine function.

So I am looking to add a "," after the city variable, I can just add is as a constant string but if I do it that way it will show up in the forms no matter what.  This is a problem because sometime the "bill to" section is only a name and an email. 

Is there a way around this? 

*This post is locked for comments

  • Suggested answer
    L Vail Profile Picture
    65,271 on at
    RE: Report Writer Script Function Problem

    That RW function has 9 variables. You need to address each parameter. If you are not going to use one of the variables, don't skip it, just insert a blank string in that position. Here's a copy of the old Knowledge Base Article:

    Kind regards,

    Leslie

    suppress blank or empty fields that occur within the Receivables

    customer address fields. This function was added in a service pack after the initial release of 6.0. The new function is also available in the initial release of 7.0. To use this function, follow the steps below:

    Calculated Fields

    In the Toolbox choose Calculated Fields from the drop down list, then choose the New button.

    In the Calculated Field Definition window, type Customer Name as the name.

    For the Result type choose String from the drop-down list.

    The Expression Type should be Calculated

    In the Functions section:

    Place your cursor in the Calculated Expression

    Choose the Functions tab.

    Select User Defined

    Click on the drop down list for Core and choose System.

    Click on the drop down list for Function and choose RW_SelectAddrLine and choose the Add button.

    In the Constants section:

    Choose the Constants Tab.

    Click on the drop down list for Type and choose Integer.

    Type 1 in the Constants field, and choose the Add button.

    In the Fields section:

    Place your cursor in the Calculated area.

    Choose the Fields tab.

    Click on the drop down list for Report Table and choose RM Customer Master.

    Click on the drop down list for Table Fields and choose Customer Name and choose the Add button.

    In the Fields section:

    Place your cursor in the Calculated area.

    Choose the Fields tab.

    Click on the drop down list for Report Table and choose RM Customer Master

    Click on the drop down list for Table Fields and choose Contact Person and choose the Add button.

    In the Fields section:

    Place your cursor in the Calculated area.

    Choose the Fields tab.

    Click on the drop down list for Report Table and choose RM Customer Master

    Click on the drop down list for Table Fields and choose Address 1 and choose the Add button.

    In the Fields section:

    Place your cursor in the Calculated area.

    Choose the Fields tab.

    Click on the drop down list for Report Table and choose RM Customer Master

    Click on the drop down list for Table Fields and choose Address 2 and choose the Add button

    In the Fields section:

    Place your cursor in the Calculated area.

    Choose the Fields tab.

    Click on the drop down list for Report Table and choose RM Customer Master

    Click on the drop down list for Table Fields and choose Address 3 and choose the Add button

    In the Fields section:

    Place your cursor in the Calculated area.

    Choose the Fields tab.

    Click on the drop down list for Report Table and choose RM Customer Master

    Click on the drop down list for Table Fields and choose City and choose the Add button

    In the Fields section:

    Place your cursor in the Calculated area.

    Choose the Fields tab.

    Click on the drop down list for Report Table and choose RM Customer Master

    Click on the drop down list for Table Fields and choose State and choose the Add button

    In the Fields section:

    Place your cursor in the Calculated area.

    Choose the Fields tab.

    Click on the drop down list for Report Table and choose RM Customer Master

    Click on the drop down list for Table Fields and choose Zip and choose the Add button

    In the Fields section:

    Place your cursor in the Calculated area

    Choose the Fields tab.

    Click on the drop down list for Report Table and choose RM Customer Master

    Click on the drop down list for Table Fields and choose Country and choose the Add button

    The Calculated Expression should read:

    FUNCTION_SCRIPT (rw_SelectAddrLine

    1

    RM_Customer_MSTR.Customer Name

    RM_Customer_MSTR.Contact Person

    RM_Customer_MSTR.Address1

    RM_Customer_MSTR.Address2

    RM_Customer_MSTR.Address3

    RM_Customer_MSTR.City

    RM_Customer_MSTR.State

    RM_Customer_MSTR.Zip

    KbDisplay_Print

    RM_Customer_MSTR.Country)

    This will be the calculated field for the first line of the address, in this case it would be Customer Name. You would have to create 5 more calculated fields the exact same way but the first integer value will increase by 1. You can enter any string value in the first 5 fields and the last field which is number 9. String values 6-8 must be City, State, Zip or a blank string. This field will be formatted so it prints correctly.

    This article was TechKnowledge Document ID: 26847

    The issue that is described in the Issue section does not apply to Microsoft Dynamics GP 10.0.

  • Kumar_Sat Profile Picture
    1,218 on at
    RE: Report Writer Script Function Problem

    You can create a conditional field  to print , (comma) only when the city field is not blank.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Almas Mahfooz Profile Picture

Almas Mahfooz 3 User Group Leader

Featured topics

Product updates

Dynamics 365 release plans