ETASCOM CRM V3 - Documentation API
    Preparing search index...

    Function isUnique

    • Checks if a record is unique in a Prisma table.

      Type Parameters

      • T extends
            | "$connect"
            | "$disconnect"
            | "$on"
            | "$transaction"
            | "$extends"
            | "client"
            | "$queryRaw"
            | "$queryRawUnsafe"
            | "$executeRaw"
            | "$executeRawUnsafe"
            | "user"
            | "userRole"
            | "userRolePermission"
            | "systemLog"
            | "employee"
            | "account"
            | "session"
            | "salesOffer"
            | "rawMaterial"
            | "finishedProduct"
            | "post"
            | "postComment"
            | "postLike"
            | "passwordVault"
            | "request"
            | "requestComment"
            | "stockMovement"
            | "workOrderStep"
            | "workCenter"
            | "scanLog"
            | "workStation"
            | "productionSession"
            | "productionAlert"
            | "maintenanceSystem"
            | "toolMaintenanceLog"
            | "equipmentMaintenanceLog"
            | "supplier"
            | "businessOpportunity"
            | "opportunityAction"
            | "opportunityReport"
            | "opportunityReportAttendee"
            | "company"
            | "opportunityActionAssignee"
            | "opportunity"
            | "opportunityOpportunityAction"
            | "opportunityHistoryLog"
            | "prospectHistoryLog"
            | "opportunityProgressReport"
            | "qualityControl"
            | "clientCommander"
            | "clientMeeting"
            | "clientMeetingMail"
            | "clientMeetingParticipant"
            | "toolAssignment"
            | "tool"
            | "costHistory"
            | "currency"
            | "receiptInspection"
            | "receptionLineInspection"
            | "leave"
            | "employeeExpense"
            | "timeTracking"
            | "journalEntry"
            | "bankReconciliation"
            | "financialStatement"
            | "accountingAdjustment"
            | "generalExpense"
            | "payment"
            | "userEmailAccount"
            | "operation"
            | "mRPSimulation"
            | "opportunityReportOutcome"
            | "manufacturingOrder"
            | "workOrder"
            | "workOrderTimeTracking"
            | "productionTrackingEntry"
            | "userPermission"
            | "verificationToken"
            | "twoFactorCode"
            | "systemSetting"
            | "unitOfMeasure"
            | "currencyExchangeRate"
            | "tax"
            | "chartOfAccounts"
            | "journal"
            | "journalEntryLine"
            | "bankReconciliationLine"
            | "financialStatementLine"
            | "clientAccount"
            | "supplierAccount"
            | "rawMaterialCategory"
            | "finishedProductCategory"
            | "address"
            | "contact"
            | "legalIdentifier"
            | "rawMaterialSupplier"
            | "rawMaterialSupplierMOQ"
            | "finishedProductPrice"
            | "equipment"
            | "partnerOpportunity"
            | "opportunityContact"
            | "emailBusinessConfig"
            | "emailBusinessDocument"
            | "opportunityForecast"
            | "opportunityForecastLine"
            | "productionProgram"
            | "productionProgramLine"
            | "productionProgramUnplannedLine"
            | "clientMeetingCompany"
            | "clientMeetingOutcome"
            | "lead"
            | "transporter"
            | "warehouse"
            | "stockLocation"
            | "stockLot"
            | "productLabel"
            | "stockLabel"
            | "deliveryNote"
            | "deliveryLine"
            | "receptionNote"
            | "receptionLine"
            | "lineInspectionDimensionalCheck"
            | "dimensionalCheck"
            | "purchaseOrder"
            | "purchaseOrderLine"
            | "supplierInvoice"
            | "supplierInvoiceLine"
            | "equipmentAssignment"
            | "billOfMaterial"
            | "routing"
            | "operationAlternativeResource"
            | "operationConsumedComponent"
            | "operationTool"
            | "operationClaim"
            | "instruction"
            | "operationTimingABC"
            | "operationTemplate"
            | "label"
            | "labelTemplate"
            | "tabletConfig"
            | "salesOfferLine"
            | "salesOfferSeriesPriceTier"
            | "salesOfferMOQ"
            | "salesOrder"
            | "salesOrderLine"
            | "orderPlanning"
            | "orderPlanningLine"
            | "orderPlanningMaterialCheck"
            | "invoice"
            | "invoiceLine"
            | "fAQ"
            | "helpDocument"
            | "file"
            | "payslip"
            | "payslipLine"
            | "training"
            | "employeeTraining"
            | "jobDescription"
            | "hRConfig"
            | "securityConfig"
            | "securityLog"
            | "archivedEmail"
            | "ediPartner"
            | "ediInterchange"
            | "ediFunctionalGroup"
            | "ediIdoc"
            | "ediIdocSegment"
            | "ediMessage"
            | "ediMessageLine"
            | "ediMapping"
            | "ediProductMapping"
            | "ediUnitMapping"
            | "ediCurrencyMapping"
            | "ediQueue"
            | "ediAcknowledgment"
            | "ediLog"
            | "ediStatistics"
            | "ediSchedule"
            | "ediCertificate"
            | "ediAlertRule"
            | "ediErrorCode"
            | "mRPSimulationLine"
            | "productionIndicator"
            | "productionIndicatorValue"
            | "productionDocumentConfig"

      Parameters

      • table: T

        Table name in Prisma schema.

      • fields: Record<string, unknown>

        Fields to check for uniqueness.

      • Optionalexclude: Record<string, unknown>

        Fields to exclude from the check.

      Returns Promise<boolean>

      • true if unique, otherwise false.
      • Error if the table does not exist.