Hi and happy new year for all!!
I have a performance problem with a import xmlport and i dont understand why... My XMLport import a TXT file with lines of sales invoices. The file, usually have 1880 lines.
The code in the xmlport evaluate imported elements and generate new sales invoice in Dynamics NAV 2009 SP1. The xmlport not perform complex business logic, but for example, will cost approximately 10 minutes to process 50 records...
The extrange thing is i have a dataport with the same code in the same SQL database and this is very fast.
The code to run the xmlport is:
CLEAR(ImportXMLPort);
ImportXMLPort.GetParameters(var1,var2);
FileIn.OPEN(InvHdrTxt);
FileIn.CREATEINSTREAM(StreamIn);
ImportXMLPort.SETSOURCE(StreamIn);
ImportXMLPort.IMPORT;
FileIn.CLOSE();
Anyone have any idea who can help me, please?
Thanks in advance!!!
Answers
1880 records doesn't sound like it should take that long to process and there could be a problem with the XML Parser or something else. How big is the data file that you are trying to import? I've seen NAV struggle with files over 200Mb in size.
Epimatic Corp.
http://www.epimatic.com
Hi jlandeen, and thanks for your reply.
The files that i'm trying to import ara between 200 and 300 Kb, I don't think the files are very big...
I'll try what you've said me and see if the problem really is in updating data or is in XMLPort's reading.
Thanks a lot!
Epimatic Corp.
http://www.epimatic.com
Thnaks very much for your reply, and sorry for the delay in my reply.
Finally, is sure that the problem isn't the file, because i've tested XMLPort with a file with a single row and also slows down the system.
At this point, I decided to comment the code that was on the trigger OnBeforeInsertRecord and reading of data has been very rapid. This means that the problem is in the code of the trigger.
After analyzing the code, I noticed that the problem appears in the following statement:
SalesHeader.VALIDATE("Sell-to Customer No.",Cust."No.");
If I change the statement to assign the value without making VALIDATE, the behavior is fast.... ](*,)
Any idea??
Thanks a lot!
I find in a lot of implementations there is also conditional logic to perform custom checks and update other values and tables when a new order is created or assigned to a customer. What happens when this action is performed by a user when inserting a new sales order? Does it take a long time for the system to respond and update the header information?
Epimatic Corp.
http://www.epimatic.com
What I find curious is that when a user inserts a new sales invoice, the system is very flexible, and this process is running with Dataports, and is pretty fast.
However, thanks to your comment, I tried to post some of the code, specific to this database, and that's the problem.
I do not understand because it is only slow when the call is made from a XMLport, but honestly, all the invoices that are loaded through this system, do not need this part of the code, so I resolved the case on! \:D/ \:D/
Thank you very much for everything jlandeen!!!!
You should flag this post as solved with the little green check mark too - I think they like when that happens on here
Epimatic Corp.
http://www.epimatic.com
Sorry but.... How i flag this post as solved? Where is the green check mark... ? #-o #-o
Thanks!!
Modify your first post and you'll have a extra option near your subject. Attribute I think.
Set the attribute to solved and submit.
|To-Increase|
Thanks Sog, Post edited and solved!!! =D>