if ((select firstonly RecId from SalesTable where SalesTable.SalesId == "З00001").RecId) { } else { }