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 :
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

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans