web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

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 90

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?

I have the same question (0)
  • Dallefeld Profile Picture
    211 User Group Leader on at

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

    pastedimage1643913152203v1.png

  • James De Filippo Profile Picture
    90 on at

    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
    211 User Group Leader on at

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

  • James De Filippo Profile Picture
    90 on at

    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

  • Suggested answer
    Marco Mels Profile Picture
    on at

    Hello,

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

    Thanks.

  • Vaishnavi J Profile Picture
    3,062 on at

    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.

  • James De Filippo Profile Picture
    90 on at

    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,062 on at

    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
    90 on at

    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

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,785

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,007 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 948 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans