diff --git a/src/commands/force/user/permsetlicense/assign.ts b/src/commands/force/user/permsetlicense/assign.ts index 567d9178..92e73b61 100644 --- a/src/commands/force/user/permsetlicense/assign.ts +++ b/src/commands/force/user/permsetlicense/assign.ts @@ -97,13 +97,13 @@ export class UserPermsetLicenseAssignCommand extends SfdxCommand { // Convert any aliases to usernames const resolvedUsername = (await GlobalInfo.getInstance()).aliases.resolveUsername(usernameOrAlias); - const AssigneeId = ( - await this.org - .getConnection() - .singleRecordQuery<{ Id: string }>(`select Id from User where Username = '${resolvedUsername}'`) - ).Id; - try { + const AssigneeId = ( + await this.org + .getConnection() + .singleRecordQuery<{ Id: string }>(`select Id from User where Username = '${resolvedUsername}'`) + ).Id; + await this.org.getConnection().sobject('PermissionSetLicenseAssign').create({ AssigneeId, PermissionSetLicenseId: this.pslId,