Export (0) Print
Expand All

Monitoring the Import Progress

banner art

[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.

Example

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;

See Also

Other Resources


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2014 Microsoft