Skip to main content

Notifications

Microsoft Dynamics GP forum
Answered

Remove first # of characters of a field in report writer

Posted on by Microsoft Employee

Hello,

Trying to print a field.

Eg. CUST PO # 123456456568977. I only need to print PO # 123456456568977

Is this possible in Report Writer?

Any help is appreciated

Categories:
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Remove first # of characters of a field in report writer

    Thank you! It worked!

  • Suggested answer
    Nanook Software Profile Picture
    Nanook Software 587 on at
    RE: Remove first # of characters of a field in report writer

    Yes, but you need to create 2 calculated fields to complete the task.

    Functions don't liked to be nested in Report Writer.

    We need to utilize the User-Defined Functions (System) to accomplish this...

    #1 Calculated Field (POLen) - Defined the # chars from the right we want to have

      Result Type = Integer

      Calculation = FUNCTION_SCRIPT( RW_Length POP_PO.PONumber) - 5

          POP_PO.PONumber = Is the PO Number Field from the table you need

          5 = Is the trim left length

    #2 Calculated Field (TrimedPONumber) - Is the timed String of the PO#

      Result Type = String

      Calculation = FUNCTION_SCRIPT( RW_Right POP_PO.PONumber POLen)

         POP_PO.PONumber = Is the PO Number Field from the table you need

         POLen = Is the right string length

    I hope this helps...

    User-Defined Functions are great, but not well documented.

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,522 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,441 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Product updates

Dynamics 365 release plans