Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Report writer combine integer and string fields

(0) ShareShare
ReportReport
Posted on by 185

I am trying to concatenate some fields together so I do not have so many different calculated fields.

We have a discount % stored as an integer and I would like to concatenate this with a string in one calculated field, is this possible?

I have tried using RW_Format but had no success.

*This post is locked for comments

  • Mariano Gomez Profile Picture
    26,225 on at
    RE: Report writer combine integer and string fields

    Glad to hear! Now, I would appreciate if you can mark the response as the answer.

  • Verified answer
    Alvin Evans Profile Picture
    185 on at
    RE: Report writer combine integer and string fields

    I managed to get this working by changing the field data type from integer to currency, I could then use RW_Format to convert the field to a string.

  • Alvin Evans Profile Picture
    185 on at
    RE: Report writer combine integer and string fields

    Hi Mariano

    When using the RW_Format function to convert the integer to string like you explained above I am getting an error when running the report:

    "User defined function failed in execution"

  • Verified answer
    Mariano Gomez Profile Picture
    26,225 on at
    RE: Report writer combine integer and string fields

    Unfortunately, there's no direct way to do this. You will first have to create a string calculated field to convert the integer value to a string with RW_Format. Here's the signature of that RW function:

    {-----------------------------------------------------------------------
    RW_Format
    
    Converts the contents of a currency or variable currency field to a string, applying the specified formatting.
    -----------------------------------------------------------------------}
    
    function returns string OUT_string;
    in vcurrency IN_currency; 	{ value to format }
    in integer IN_cur_symbol; 	{ non zero = display currency symbol }
    in integer IN_thou_sep; 	{ non zero = display thousands separator }
    in integer IN_dec_places;	{ number of decimal places }
    in integer IN_neg_type;		{ how to display negative values }
    
    { Values for IN_neg_type:
    
    1 = SYSTEMNEG
    2 = MINUSNEG
    3 = PARENNEG
    4 = CRNEG
    
    + 100 for % 
    }


    In your case, when called from RW, it should look something like this (note, I am using parenthesis and comas for clarity), with the 104 value used to display the percentage symbol. If you don't want the symbol displayed, just send in a value of 4.

    FUNCTION_SCRIPT(RW_Format(SomeInteger, 0, 1, 0, 104))


    Once you have the calculated field created, you can create one last string calculated field, and concatenate it as you see fit with other string fields using the CONCAT operator (#) in RW.

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