"The value of COPYSTR parameter 3 is outside of the permitted range.

Hi,

the error that you can see in the subject is showed when we try to import an xml file from the Import TransportOrders page.

If I check I can find the file that I tried to import in the Processed TransportOrders page.

If we try the same procedure with the same file in the test environment, it works without problem.

We tried also to delete the last records from the Imported TransportOrders Table, but without results.

I have seen on this forum a lot of post with the same error, due to a different problem (printer setup).

The version of Dynamics that we use is: 5.0 S.P(.1)

Please let me know if you need more information about the problem.

Thank you for your help!

Hi Elisa !

Welcome to DUG .

This looks like a code related issue? Are you sure the versions of the xml port match on both systems ?

You should run the import with debugger on to see where it stops, then you’ll see what the problem is !

regards,

gabor

Hi, thank you for your answer.

I have just compared the code that I can see if I debug in the Live environment with the test and it’s really the same.

It could be an error maybe due to a previous import?

Thank you for your support, the company that should support us is not helping…

I Suggest look at the file also which you are trying to import .Maybes something is missing in file.

Yes, but in this case it should happen also in the test environment, no?

Is both the object are same in Test and live environment ???

Check the modified date of object in both the environment .

Sure, it’s the same.

I have just compared also the structure of the tables in Live and Test environment. Are equal.

Not sure that could help, but the error is related to a date, I think.

// Year
SepPos := STRPOS(VarText,’-’);
txtYear := COPYSTR(VarText,1,(SepPos - 1));
IF NOT TextToInteger(Year, txtYear) THEN EXIT(FALSE);

Activate debugger and check at which line it get stop or showing error in code.

I have already posted…

txtYear := COPYSTR(VarText,1,(SepPos - 1));

SepPos := STRPOS(VarText,’-’);

I guess SepPos variable has 0 value which means VarText has no ‘-’.

Please add Message(’%1’,SepPos); after above code and check

You may want to post the code line where the debugger stops . It’ll show sth to us.

It also may be that the parameter is data based (likely) thus you can see where the issue comes from.

g.

The dubug is stopping in the bolder line that you can see below (the 4th):

// Year
SepPos := STRPOS(VarText,’-’);
txtYear := COPYSTR(VarText,1,(SepPos - 1));
IF NOT TextToInteger(Year, txtYear) THEN EXIT(FALSE);

3th… sorry…

Yep as Mohana says likely that no ‘-’ sign in the file…

And why it’s working in test?

Your code may be different :slight_smile:

Not too many choices.

emh, ok. I trust you.

So what I can do to solve the problem?

Sorry, I’m working on MSD since 2 weekd…

Are the both Test and Dev databases on same system?

Are the date formats same in both systes? (if different machines)

check what is the value of date in xml file…

yes, the both Test and Dev databases are on same system

I have tried to import also without date… it;s no working…