recordsPerBatch = 25; minutesBetweenBatches = 2; processRunninMsg = "A Bulk Import Process is currently running!"; enableOneWaySync = application.ptProfile.getOneWaySyncStatus(); // true = removes profiles from CS - "one-way sync" (not just an "import" of the external data) processName = 'Profile-Bulk-Import'; processSchedule = application.ADF.scheduler.getScheduleStatus(processName); processStatus = 'nonexistant'; if ( StructKeyExists(processSchedule,"status") AND LEN(TRIM(processSchedule.status)) ) processStatus = processSchedule.status; if ( !StructKeyExists(Request,"ProfileImportHideOutput") ) { extProfileQry = application.ptProfile.profileService.getExternalProfileData(); extProfileQry = application.ptProfile.profileService.scanProfileDataForChanges(qry=extProfileQry); recordsToImport = extProfileQry.RecordCount; if ( enableOneWaySync ) { syncProfileQry = application.ptProfile.profileService.afterImportCleanUpProfileQry(); recordsToRemove = syncProfileQry.RecordCount; } } if ( processStatus NEQ 'active' ) { try { application.ptProfile.profileService.autoImportUpdate( restart=1, startAt=1, passCount=recordsPerBatch, scheduleProcess=1, delayMinutes=minutesBetweenBatches, usernameFld="userid" ); } catch (any e) { writeoutput(e); } }

Profile Import Background Job

#processRunninMsg#
Records To Import/Update: #recordsToImport#
Records To Remove: #recordsToRemove#
Check Bulk Import Processing Status
/* // invalidate all cache Application.CacheInfoCache.InvalidateAll(); // kick off a reindex-the-world - collectionName = #searchCollectionList# if ( LEN(TRIM(searchCollectionList)) ) { srchEngine = Server.CommonSpot.ObjectFactory.getObject("Search"); srchEngine.reindexCollection(searchCollectionList); } */