if ( NOT StructKeyExists(request.params, "action") )
request.params.action = "form";
renderStats = false;
if ( StructKeyExists(request.params,"stats") AND IsBoolean(request.params.stats) )
renderStats = request.params.stats;
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;
processRunningMsg = "A Bulk Import Process is currently running! The 'Start Process' button as been deactivated.";
statsLoadingMsg = "Loading... may take a few seconds to calculate.";
application.ptProfile.scripts.loadFontAwesome();
application.ptProfile.scripts.addHeaderCSS(headerCSS,"TERTIARY");
application.ptProfile.scripts.addFooterJS(footerJS,"TERTIARY");
recordsToImport = 0;
recordsToRemove = 0;
if ( renderStats )
{
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;
}
}
Error:User session could not be validated! Record could not be deleted.
// Check the Total value
if ( NOT StructKeyExists(request.params, "total") )
request.params.total = 'ALL';
// Check the Update Check value
if ( NOT StructKeyExists(request.params, "check") )
request.params.check = 'pre-schedule';
// Check the count
if ( NOT StructKeyExists(request.params, "count") )
request.params.count = 1;
// Check the pause minutes
if ( NOT StructKeyExists(request.params, "pause") )
request.params.pause = 5;
// Check if continuous scheduled process
if ( NOT StructKeyExists(request.params, "cont") )
request.params.cont = false;
// Check if continuous scheduled process
if ( NOT StructKeyExists(request.params, "restart") )
request.params.restart = false;
// Check if restart position
if ( NOT StructKeyExists(request.params, "start") OR ( request.params.start LTE 0 ) )
request.params.start = 0;
// Check if restart is checked
if ( NOT request.params.restart )
request.params.start = 0;
// Start the processing
if ( processStatus NEQ 'active' )
{
try
{
application.ptProfile.profileService.autoImportUpdate(restart=request.params.restart,passCount=request.params.count,scheduleProcess=request.params.cont,delayMinutes=request.params.pause,startAt=request.params.start);
}
catch(any ex)
{
WriteOutput("Error: " & ex.message);
WriteDump(var=ex,expand=true);
}
}