Monitoring the Import Progress
[Applies to: Microsoft Dynamics CRM 4.0]
To monitor the progress of the import, run the import operation on the main thread by using one of the following messages:
Query the results of the import on the second thread, in a loop with a Sleep delay (1 second) between each call.
The following sample shows how to calculate the percentage of completed blocks during import.
[Jscript] // Calculate the total number of blocks and the processed number of blocks. var oDataXml = loadXmlDocument(oImportJob.data); var oAllNodes = oDataXml.selectNodes("//entity | //node | //setting | //securityrole | //workflow "); var oCompletedNodes = oDataXml.selectNodes("//entity[@result] | //node[@result] | //setting[@result] | //securityrole[@result] | //workflow[@result]"); iTotalBlocks = oAllNodes.length; iTotalProcessed = oCompletedNodes.length; var iPercentage = iTotalProcessed *100 /iTotalBlocks;
© 2010 Microsoft Corporation. All rights reserved.