Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Strange while run on batch(.Net)

(0) ShareShare
ReportReport
Posted on by

Hi all,

I faced one issue while I run some customized code on batch, which I felt a little strange.

Edt  var; // Edt of string length 2

var =  substr(Conpeek(fileRecord,1),1,3);

 

For the above piece of code

As much I know, even if we give 1,3(String size 3) for the function  substr the variable var should accept the size 2 !!

But the behavior in batch was strange it was accepting string size 3.

 

I had data in fileRecord’s first position “FR             ”

When I fetched in batch var accepted value “FR “-String with a blank space on 3rd  position and definitely .net considers blank space as string value which resulted in a wrong output for me.

 

Can anyone have any explanation for this, does our EDT properties are ignored in Batch??

*This post is locked for comments

  • Denis Macchinetti Profile Picture
    16,444 on at
    RE: Strange while run on batch(.Net)

    Hi Abhida

    Let me know if my reply isn't clear or if you have need more details.

  • Verified answer
    Denis Macchinetti Profile Picture
    16,444 on at
    RE: Strange while run on batch(.Net)

    Hi Abhida

    Take a look at msdn.microsoft.com/.../cc584291.aspx, "X++ Strings Declared with a Maximum Length" section.

    Practically, in Batch ( CIL ), the X++ String type become System.String

    The System.String type in .NET Framework does not have a property that corresponds to the maximum length of an X++ str, and string truncation does not occur.

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

Announcing the Engage with the Community forum!

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics AX (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 100 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 48

#3
Zain Mehmood Profile Picture

Zain Mehmood 6 Moderator

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans