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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Error number 25 in the script

(0) ShareShare
ReportReport
Posted on by 35

Hi,

I have class where it process all the vouchers and its transactions and place it in a XML document in a specified folder.We run this class in batch during month end or if any error occur in GL transactions.

Its running fine from past few years now its is getting error ed out. I have created a job and placed the code from the method in the class(Which is used to generate the XML).So i am taking a particular voucher with minimum of 5k transactions in it.But when i try to run that job it is stopping particularly at the count of 3783 records.

i could not find the reason why it is behaving like this. below is the example code which i am trying

str XML(Name UniqueId,Name FileId)
{
Lines Lines;
Header Header;

str xml;

System.Text.Encoding utf8;
System.Byte[] bytes;
object ftpo;
object ftpResponse;
System.Net.FtpWebRequest request;
System.Net.NetworkCredential credential;
System.IO.Stream requestStream;

InteropPermission permission = new InteropPermission(InteropKind::ClrInterop);
str UId,Pwd;
int i=1;

Table3 t2;
;

xml = "<XXXXX><MsgData>";

while select Header where Header.ProcessID == "XXXXXXXX" && Header.FILEID == "XXXXXXX"
{

xml = xml + '<XXXX><XXXXX class="R">';

xml = xml + "<XXXXX>1</XXXXX>";
xml = xml +"<XXXX>"+(Header.FILEID)+"</FILEID>";
xml = xml + "<ID>" + (Header.ID) + "</ID>";
xml = xml + "<XXX>" +(Header.DATE) + "</DT>";
xml = xml + "<BUSINESS_UNIT>" + (Header.UNIT) + "</NIT>" ;

xml = xml + "<XXXX>"+(Header.XXXXX)+"</XXXXX>";
xml = xml + "<YYYY>"+(Header.YYYY)+"</yyyy>";
xml = xml + "<ZZZZ></ZZZZZ>";
xml = xml + "<CCCCC>"+(Header.CCCCC)+"</CCCCC>";
xml = xml + "<CCCC>"+(Header.CCCC)+"</CCCCC>";

XML feilds
.
.
.
.
.
.
.

while select Lines order by LINECOUNT where Lines.FILEID == Header.FILEID
&& Lines.JID == Header.JID
&& Lines.JDATE == Header.JDATE
&& Lines.ProcessID == "XXXXXX"
{

i++;

ttsbegin;
t2.Field1 = i;
t2.LINECount = Lines.Count;
t2.insert();
ttscommit;
// if (Lines.Count > 3784)
{
xml = xml + (XXXXX);

xml = xml + "<CCCCC>2</CCCC>";
xml = xml + "<FILEID>"+(Lines.FILEID)+"</FILEID>";
xml = xml + "<ID>"+(Lines.ID)+"</ID>";
xml = xml + "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
xml = xml + "XXXXXXXXXXXXXXXXXXXXXXXX";

xml = xml + "XXXXXXXXXXXXXXXXXXXXXX";
xml = xml + "XXXXXXXXXXXXXXXXXXXXXXXX";
xml = xml + "XXXXXXXXXXXXXXXXXXXX";
xml = xml + "";
xml = xml + "";

xml = xml + "";
xml = xml + "";
xml = xml + "";
xml = xml + "";
xml = xml + "";

xml = xml + "";
xml = xml + "";

xml = xml + ("</IN>");

}
}
xml = xml + "</IN></Transaction>";
}

xml = xml + "</MsgData></IMP>";


return CallDPWebservice::SendGLtoXXX(xml);
}

Above is the sample code.There are many XML fields more to fill i have just placed a sample code.

Please help in finding the solution why it is limiting the records to a specific number.

I have kept the buffer size to 64KB.

Is there any things take care.please check this and suggest me to get rid of this.

Thanks,

Phani

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    239,208 Most Valuable Professional on at

    I opened this thread to give it a more descriptive title, but I didn't see much information even in body. What error did you get? On which line of code?

    Note that your code will put a lot of data to memory, which may become a problem. Also, what's the point of xml = xml + ""?

  • phanivarma Profile Picture
    35 on at

    Hi,

    There is no error is particular place of code.

    While running this job i have checked the reference table "Table3" where i am checking the count in SQL at the point where it is reaching 3783 records for any IDMSProcessID .which has more records it is stopping at that point and error is "error number 25 in the script " is displayed.

    XML= XML +"" these have a the values actually like

    xml = xml + "<RECORD_IDENTIFIER>2</RECORD_IDENTIFIER>";

    xml = xml + "<ZI_FILEID>"+(Lines.ZI_FILEID)+"</ZI_FILEID>";

    xml = xml + "<JOURNAL_ID>"+(Lines.JOURNAL_ID)+"</JOURNAL_ID>";

    I just have removed them and posted them thats it.

  • Martin Dráb Profile Picture
    239,208 Most Valuable Professional on at

    The error must be thrown from somewhere; you merely haven't found the place yet. That is what I would focus on.

    If there is a bug in code and you can't find it, you can try commenting out parts of code. When you find that removing a certain piece makes the solution working, you'll know where the bug is hiding.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans