diff --git a/packages/util/src/sfdx.ts b/packages/util/src/sfdx.ts index 156887b5..d8c56c12 100644 --- a/packages/util/src/sfdx.ts +++ b/packages/util/src/sfdx.ts @@ -157,7 +157,10 @@ export namespace sfdx { export async function getJsForceConnection(username?: string) : Promise { const org = await getOrg(username); - const connection = org.getConnection() as unknown; + const connection = org.getConnection() as any; + if (typeof connection.useLatestApiVersion === 'function') { + await connection.useLatestApiVersion(); + } return connection as salesforce.Connection; } }