Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested answer

Trimming text on Payment Export file

(0) ShareShare
ReportReport
Posted on by 84

Thanks to the community for resolving the previous post!

I have another issue, whereas the text length is restricted to 18 characters but some text will exceed this limit. I want to be able to trim the text, in this scnerio.

Please advise if there is any way to overcome this issue.

File Type: Variable Text

Data Type: Text

Length: 18

pastedimage1643906417501v1.png

Im wondering if i can do this by way of a Data Format?

  • James De Filippo Profile Picture
    84 on at
    RE: Trimming text on Payment Export file

    Hi Vaishnavi,

    Although i do appreciate your reply, i was hoping to use the standard data exchange definitions to achieve this result. There are many features in the payment journal that support it and would like to retain this where possible.

    Many thanks,

    James

  • Vaishnavi J Profile Picture
    3,060 on at
    RE: Trimming text on Payment Export file

    Hi James,

    You can write your own export logic and then use the COPYSTR function to trim the data.

    Here's a link to a blog where you can export data as a text file.

    www.cloudfronts.com/.../

  • James De Filippo Profile Picture
    84 on at
    RE: Trimming text on Payment Export file

    Hi Vaishnavi,

    Where would i specify this function, using a Data Exchange Definition? would it be the Data Format in the column definitions or field mapping under the line definitions.

    Thanks

    James

  • Vaishnavi J Profile Picture
    3,060 on at
    RE: Trimming text on Payment Export file

    Hi James,

    Can you use the CopyStr function?

    Which will copy the value until that number of characters is reached before exporting your file.

    CopyStr(Rec PaymentJnlLine L1."Document No.", 1, 15) as an example

    If my answer was helpful to you, please verify it so that other users know it worked. Thank you very much.

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: Trimming text on Payment Export file

    Hello,

    Please ask your partner to raise this as an issue to Microsoft support. Looks like something that needs hot fixing.

    Thanks.

  • James De Filippo Profile Picture
    84 on at
    RE: Trimming text on Payment Export file

    Hi Kim,

    Thanks for getting back to me.

    We have found that using Fixed Text, if the value length is below the length specified in the data exchange definition it will cause an error. 

    Please advise, any help on this would be appreciated.

    Regards,

    James

  • Dallefeld Profile Picture
    175 User Group Leader on at
    RE: Trimming text on Payment Export file

    Oh I see, does it have to be variable? Could you change to fixed text?

  • James De Filippo Profile Picture
    84 on at
    RE: Trimming text on Payment Export file

    Hi Kim,

    Thanks for your response.

    We do in fact have a length specified as 18, but the actual field value in this instance is 30. If this was a fixed text file type, then it would automatically trim the value but as this is a variable text it doesn't appear to be doing that.

    Please advise.

    Thanks

    James

  • Dallefeld Profile Picture
    175 User Group Leader on at
    RE: Trimming text on Payment Export file

    In the data exchange definition. you enter the length of the field for the export file.

    pastedimage1643913152203v1.png

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 >

Featured topics

Product updates

Dynamics 365 release plans