How to use the jsforce.Date.TOMORROW function in jsforce

To help you get started, we’ve selected a few jsforce examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eltoroit / ETCopyData / src / @ELTOROIT / Importer.ts View on Github external
return new Promise((resolve, reject) => {
			// DELETING
			Util.writeLog(`[${org.alias}] Deleting records from [${sObjName}]`, LogLevel.TRACE);
			org.conn.bulk.pollTimeout = org.settings.pollingTimeout;
			// LEARNING: Deleting sObject records in bulk
			org.conn.sobject(sObjName)
				.find({ CreatedDate: { $lte: Date.TOMORROW } })
				.destroy(sObjName)
				.then((results: RecordResult[]) => {
					let totalSuccess: number = 0;
					let totalFailures: number = 0;
					results.forEach((result: any) => {
						if (result.success) {
							totalSuccess++;
						} else {
							if ((result.errors.length === 1) && (result.errors[0] === "ENTITY_IS_DELETED:entity is deleted:--")) {
								// Ignore error
							} else {
								totalFailures++;
								msg = `*** [${org.alias}] Error deleting [${sObjName}] records. ${result.errors.join(", ")}`;
								Util.writeLog(msg, LogLevel.ERROR);
							}
						}

jsforce

Salesforce API Library for JavaScript

MIT
Latest version published 11 days ago

Package Health Score

86 / 100
Full package analysis