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

Announcements

News and Announcements icon
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

I have the same question (0)
  • Verified answer
    Denis Macchinetti Profile Picture
    16,444 on at

    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.

  • Denis Macchinetti Profile Picture
    16,444 on at

    Hi Abhida

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

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans