Nama ERP DocsNama ERP Docs
Home
Namasoft.com
Data Model
GitHub
Home
Namasoft.com
Data Model
GitHub
  • Home

    • Search
    • Guides

      • بعض المعلومات عن استعمال هذا الموقع
      • Utility Links
      • System Minimum Requirements
      • Nama ERP Installation Guide
      • Reports Guide (Jasper Reports)
      • Keyboard Shortcuts
      • Layout Names:
      • Entity Flows

        • مقدمة عن مسارات الكيان
        • Field Values Calculator
        • Importing Data from Excel or Queries
        • EAGenerateEntityFromEntityAction
      • دليل استخدام أداة إنشاء التقارير ونماذج الطباعة
      • الفواتير والضرائب والخصومات

        • ربط سندات الدفع بالفواتير
        • دليل استعمال وتشغيل الضرائب والخصومات بنظام Nama ERP وتأثيرها على حساب قيم الفواتير
        • دليل ربط Nama ERP بأنظمة الفاتورة الإلكترونية
        • الربط مع هيئة الزكاة والدخل بالسعودية
        • Electronic Receipt (Egypt Tax eInvoice) تفعيل الإيصال الإلكتروني - الفاتورة الإلكترونية - مصر
      • Tempo Language Manual
      • Sending Invoices and Documents to Customers
      • SMS and WhatsApp Configuration in Nama ERP
      • Field Filter with Criteria
      • تعديل الترجمات في نظام نما
      • Criteria Based Validation
      • صيغ الحضور والانصراف
      • الربط مع ماكينات الحضور والانصراف
      • Email By Parameterized Reports In Task Scheduler
      • Nama Properties
      • Customer Reward Points (Loyalty Points)
      • دليل استعمال النقاط الفنية في نقاط البيع
      • تطبيق الهواتف المحمولة
      • ORACLE JDBC Integration Connection in context.xml for integration purposes
      • Nama ERP REST API
      • Criteria from Text Parser
      • ضوابط إنشاء طلبات تطوير من قبل أقسام الدعم الفني والتجهيز بالشركة
    • Examples

      • أمثلة لمسارات كيان
    • Reprocessing Transactions

      • Reprocessing Quantity, Cost, and Stock Ages
      • Accounting Utilities - Ledger and Debt Ages Reprocessing
      • Queries to Check for (and Fix) Cost And Qty Problems
      • Inventory Related Utility Queries
      • Manufacturing Utilities
      • Fixed Assets Module Utilities
      • Real Estate Utilities
      • Database Related Operations
      • Suggest Indexes for Large Detail Tables
      • General Purpose Utility Queries
      • Replication Utilities
    • Frequently Asked Questions

      • أسئلة عامة
      • أسئلة شائعة حول تعديل الشاشات
      • أسئلة شائعة عن التنبيهات والرسائل
      • أسئلة عامة عن GUI Post Actions
      • أسئلة شائعة عن مسارات الكيان
      • أسئلة شائعة حول الفواتير والدفع
      • أسئلة في موديول التوزيع والمخازن والمبيعات والمشتريات
      • أسئلة شائعة حول موديول التصنيع في نظام Nama ERP
      • أسئلة شائعة حول نقاط البيع
      • أسئلة شائعة في موديول الرواتب والموارد البشرية
      • أسئلة شائعة عن تصميم التقارير
      • أسئلة شائعة حول أداة إنشاء التقارير
      • أسئلة شائعة عن الموافقات
      • أسئلة شائعة حول تطبيقات الهواتف المحمولة في نظام Nama ERP
      • أسئلة شائعة حول فلترة الحقول
      • Database Related Errors FAQ
    • AI Generated Entity Flows Documentation

      • Core

        • DeleteRelatedEntityAction
        • EAAllowUseAsFromDocOfAField
        • EAAltCodeValidator
        • EAAttachReportResultToRecord
        • EAAutoCollectSignAndSentEInvoice
        • EAAutoEscalateApprovalToFallBackEmployee
        • EAAutoEscalateApprovalToSupervisor
        • EAAutoSendEInvoice
        • EAAutomaticGenerateEntityFromEntityAction
        • EAAutomaticGenerateEntityFromEntityActionWithApproval
        • EACacheEvicter
        • EACalcCurrencyRate
        • EACalcCurrencyRateInDetails
        • EACheckAndUpdateLinkAtOnlinePaymentTransactionSysEntry
        • EACheckDailyBackupOnGoogleDrive
        • EAClearGoogleDriveTrash
        • EACloseFiscalPeriodsInRange
        • EACodeValidator
        • EACopyEmptyAccountsFromBag
        • EADeleteFromAnotherServer
        • EADeleteFromQuery
        • EADeleteOldFiles
        • EADetailsRemover
        • EAEmptifyTomcatTemp
        • EAErrorIfQueryNotMatched
        • EAExecuteUpdateQuery
        • EAExecuteUpdateQueryOnDifferentDatasource
        • EAExportAttachments
        • EAFieldsValuesCalculator
        • EAForceApplyInstallmentEffects
        • EAGenerateDraftEntityFromEntityAction
        • EAGenerateDraftEntityFromEntityActionNoFlush
        • EAGenerateEntityFromEntityAction
        • EAGenerateEntityFromEntityActionNoFlush
        • EAGenerateEntityFromEntityActionNoFlushWithApproval
        • EAGenerateEntityFromEntityActionWithApproval
        • EAGenerateKNetPaymentURLs
        • EAGenerateMyFatoorahPaymentURLs
        • EAGroovyAction
        • EAGuessEntityFromNames
        • EAIgnoringNotFoundTargetFieldsValuesCalculator
        • EAJsonRecordExporter
        • EALoyalityEarnReward
        • EAMakeCreationDateAlwaysAfter
        • EAMakeCreationDateAlwaysBefore
        • EAMakeCreationDateAlwaysBetween
        • EAMakeCreationDateInValueDate
        • EANamaCloudBackupPrepare
        • EAOpenFiscalPeriodsInRange
        • EAPostGoPayOfflinePayment
        • EAPreventChangingFields
        • EAPreventFromDocOfUsageAgain
        • EAPreventUpdateDetailedRemarkLines
        • EAPreventUseAsFromDocOfAField
        • EAPrintFormToPrinter
        • EAPrintReportToPrinter
        • EARecommitFromQuery
        • EARefreshCriticalErrors
        • EARefreshGoogleDriveOrMailToken
        • EARegenAccEffects
        • EARegenAccFromQuery
        • EAReviseUnReviseFromQuery
        • EARevokeApproval
        • EARunEntityFlow
        • EARunEntityFlowFromQuery
        • EARunManualNotification
        • EARunManualNotificationFromQuery
        • EARunTaskSchedule
        • EASQLToCSVEmail
        • EASQLToCSVFile
        • EASaveDraftsFromQuery
        • EASaveRecordsFromQuery
        • EASaveToAnotherServer
        • EASaveToAnotherServerUsingJSON
        • EAScaleImage
        • EAScaleMasterFileImage
        • EASendHttpRequestByTempo
        • EASetCreationDateToEndOfDay
        • EASetCreationDateToStartOfDay
        • EASetFieldByTemplate
        • EASortFields
        • EAWathqAddressFetcher
        • EAWathqBasicInfoFetcher
        • EAWathqCommercialInfoFetcher
        • EAWordTemplate
        • SQLDraftImporter
        • SQLDraftImporterFromDifferentDataSource
        • SQLImporter
        • SQLImporterFromDifferentDataSource
      • Accounting Module

        • EAAddAccountingEffect
        • EAClearLedgerLines
        • EAGenInvestmentDocClaimingDoc
        • EAGenJournalEntry
        • EAGenTreasuryBillCloseDoc
        • EARVPVControlJournal
        • EAReverseLedgerTrans
        • EAShortenLedger
        • EAShortenLedgerChangeToAccountCurrency
        • EASortLedger
      • AI Module

        • EAEmbedFileToAIDB
      • Contracting Module

        • EAUpdateExtractsEffectsOnPaymentDocs
        • EAUpdateRemarksInContractorExtractFromProjectContractTermDescription
        • EAUpdateRemarksInExtractFromContractTermDescription
      • CRM Module

        • EACRMContractBodyShapersCheckIn
        • EACRMDevReqPadLeftRelativeWeight
      • EGTax Reader Module

        • EAReadRecentTaxEInvoices
      • Freight Management System Module

        • EAKWSendIPSEvents
      • Hospital Management System Module

        • EACreateAccommodationInvoice
      • HR Module

        • CalcBasicSalaryForNetSalary
        • EACalComponentFromLoan
        • EAChangeEmployeeStateHandler
        • EAClearFromDateIfFromTimeEmpty
        • EAClearToDateIfToTimeEmpty
        • EACopySalaryStructureToJobOffer
        • EACopySalaryStructureToUpdateEmpInfo
        • EADSCNormalizeTimeAttendance
        • EAEmpAttendanceSysEntryCalculator
        • EAHealthInsuranceOfferReqAction
        • EALiptisSetComponentFromAnotherWithMax
        • EAMakeSingleCheckInCheckOutIfNeeded
        • EAOyoonWorkPlaceUpdateToUpdateInfo
        • EASalaryCostCalculator
        • EASalaryNormalizeAdditions
        • EASalaryNormalizeDeductions
        • EATimeAttendanceFromDBImportIntoDocument
        • EATimeAttendanceFromDBImporter
        • EATimeAttendanceSetDefaultFromTime
        • EATimeAttendanceSetDefaultToTime
        • EAUpdateEmployeeResidencyRenewDate
        • SetAttendanceToFixedTimeIfEmpty
        • TimeAttendanceAddExtraHoursToEmpty
        • TimeAttendanceRemoveEmptyTimeLines
      • e-commerce Integration Module

        • EAEcommerceAddItemToLinker
        • EAEcommerceGuessItemBySKU
        • EAEcommerceReadAbandonedCarts
        • EAEcommerceReadOrders
        • EAEcommerceReadOrdersFromDate
        • EAEcommerceShippingHandler
        • EAEcommerceUploadQuantityCSVFileToFTPServer
        • EASalesRecalculateFreeAndRelatedItems
      • Manufacturing Module

        • EAStartOrderIfNotStarted
      • POS Module

        • EADarTibaServiceInvoiceTermSetter
      • Real Estate Module

        • EAAutoExtendExpiredRentContracts
        • EAAutoGenerateREFineDoc
        • EACancelReservationOFSalesInitialDoc
        • EAFixNextAndPreviousFromQuery
      • Service Center Module

        • EACopyMotorAndChassisSerialsAndLotsToAssembledItemInCoProds
        • EARecalculateSrvcOperationsAndMaterialsPrices
        • EARecalculateSrvcOperationsAndMaterialsPricesFromQuery
        • EASRVCCopyExecutionRemarksToJobOrder
        • EAUpdateAssemblyDocWithAssembledItemSold
        • EAUseReceiptPaperForEngineOrChassisItems
      • Supply Chain Module

        • EAApplyReservationOfDocsByQuery
        • EAAutoCreateSCDocSecondSerial
        • EAAutoCreateSCDocSerial
        • EAAutoGenSCDocFromDocWithFieldsMap
        • EAAutoGroupCloneItemFromPO
        • EAAutoSerialNumberCalculator
        • EACancelReservationOfDocsByQuery
        • EACollectAlItem
        • EACollectByItemDimension
        • EACollectLot
        • EACollectStockDocsIfEmpty
        • EACopyItemAssortmentToSCLine
        • EACopyRackCodeFromStockTaking
        • EACopyRevisionFromFromDoc
        • EACopyTaxesFromFromDoc
        • EACopyUnitCostFromInvoiceToIssueDoc
        • EAEGBRASSFixCreationDates
        • EAFillSCDetailsByBarCodeSpecs
        • EAGenAndItemSizesAndColorsAndRevisions
        • EAGenSCDocFromDocWithFieldsMap
        • EAGenSCDocFromDocWithFieldsMapWithoutFlush
        • EAGuessSourceLineByItemIdAndFreeItem
        • EAGuessSourceLineIdByItem
        • EAImportItemsFromLongTextField
        • EALotCalculator
        • EAMultiCustomerSalesOfferCreator
        • EANotifyIfSSLCertificateAboutToExpire
        • EAPreventChangingSCDocumentCriticalFields
        • EAPreventQtyLessThan
        • EAPreventQtyMoreThan
        • EAPreventRepeatedItems
        • EAPreventRepeatedValuesAtDetail
        • EAReApplyQtyTrackingEffects
        • EARecalcFreeLinesUnitPriceIfZero
        • EARecalcPurchasePrices
        • EARecalcSalesDocDiscounts
        • EARecalcSalesDocUnitPrices
        • EARecalcSalesDocUnitPricesAndDiscounts
        • EARecalculateAdditionalCost
        • EARegenAssemblyDocumentDetailsFromBOM
        • EARegenInvTransReq
        • EARegenInvTransReqFromQuery
        • EAReplaceItemBoxInSystem
        • EAReplaceItemColorInSystem
        • EAReplaceItemSizeInSystem
        • EASCDocFromDocCreator
        • EASCDocFromDocDeleter
        • EASCPreventChangingFromDocFields
        • EASalesRecalculateFreeAndRelatedItems
        • EASendCustomerToDatanuum
        • EASendInvItemToDatanuum
        • EASendInvoiceToDatanuum
        • EASendReturnedInvoiceToDatanuum
        • EASetDefaultWarehouseForServiceItems
        • EASpreadAssemblyComponents
        • EASubolSetMasterRowIdOfFreeItems
        • EASupplyChainMergeDocLines
        • EASupplyChainMergeStockTakingElectronicDocLines
        • EAUnZipSerialsInLines
        • EAUniCreteGenAssemblyBOM
        • EAUniCreteGenItems
        • EAUniCreteGenSalesInvoiceFromStockIssue
        • EAUniCreteSetQtyOfSlaveRowsAsMaster
        • EAUnicreteGenItemsAllAllowMustApply
        • EAUpdateDeliveryStatusFromSalesDocToFromDoc
        • EAUpdateLotIdDates
        • SetQuantityToOneAction
        • SetSecondUOMToDefaultIfEmpty
        • UniqueBOXInsideStockReceipt
        • ValidateSorceLinesOfFromDocAction
    • Video Tutorials

      • توثيق فيديو تنصيب Nama ERP والبرامج المساعدة
      • Supply Chain Videos

        • فيديو طريقة عمل التكاليف - 1
        • فيديو طريقة عمل التكاليف - 2
        • فيديو طريقة عمل التكاليف - 3
      • توثيق شرح التكاليف غير المباشرة والفعلي في نظام تصنيع
      • Report Wizard Videos

        • فيديو (1) شرح أداة انشاء التقار
        • شرح تفصيلي لجروبنج (Grouping) ومصادر البيانات وترتيب التقارير في Nama ERP
        • توثيق كامل لإنشاء تقارير الكروس تاب، كشف الحساب، وحركة المخزون باستخدام أداة إنشاء التقارير
        • توثيق فيديو تدريب تقرير فاتورة المبيعات وميزات الجيو الجديدة
        • شرح إنشاء نموذج طباعة شاشة مستند تصفية
        • توثيق شامل لمحتوى الفيديو حول إعداد تقارير الريبورت ويزرد وإدارة الصلاحيات

EAClearGoogleDriveTrash

This document was generated using AI Tools

Purpose

This action permanently empties the trash (recycle bin) of a Google Drive account using OAuth authentication. It removes all files and folders that have been deleted and are currently in the Google Drive trash.

When to Use This Action

  • Storage Cleanup: Free up Google Drive storage space by permanently deleting trashed items
  • Maintenance Tasks: Regular cleanup as part of system maintenance procedures
  • Storage Management: When approaching Google Drive storage limits
  • Automated Cleanup: Scheduled task to keep Google Drive accounts clean
  • Post-Backup Cleanup: After backup verification, remove old backup files from trash

How It Works

  1. Authentication: Uses OAuth credentials to connect to Google Drive API
  2. Trash Access: Connects to Google Drive trash/recycle bin
  3. Empty Operation: Calls Google Drive API to permanently delete all trashed items
  4. Completion: Returns success or failure result

Entity Type Restrictions

This action works with BaseEntity and does not require specific entity types. It operates directly on Google Drive accounts through the API.

Parameters Required

Parameter 1: OAuth File Code/ID (Required)

  • What it is: Code or ID of the OAuthFile configured for Google Drive access
  • Format: OAuthFile entity code or hexadecimal ID
  • Purpose: Provides authentication credentials for Google Drive API
  • Requirements: Must be authorized and configured for trash emptying

OAuth File Requirements

Required Permissions

The OAuthFile must be configured with proper permissions:

  • Authorized: Must complete OAuth flow and be authenticated
  • For Emptying Trash: Must have "Used For Emptying Trash of Google Drive Account" enabled

Setup Steps

  1. Create OAuthFile entity in system
  2. Configure Google Drive API credentials
  3. Complete OAuth authorization flow
  4. Enable "Used For Emptying Trash of Google Drive Account" permission flag
  5. Test connection and permissions

How Trash Emptying Works

Google Drive Trash System

  • Trash Storage: Deleted files are moved to trash, not immediately deleted
  • Storage Impact: Trashed files still count against Google Drive storage quota
  • Recovery: Items in trash can be recovered until permanently deleted
  • Automatic Deletion: Google automatically deletes items after 30 days

Empty Trash Operation

  • Permanent Action: Once emptied, files cannot be recovered
  • All Items: Empties entire trash - cannot selectively delete items
  • Immediate Effect: Files are permanently deleted immediately
  • Storage Recovery: Freed storage space is immediately available

Important Notes

⚠️ CRITICAL WARNINGS:

  1. Permanent Deletion: This action permanently deletes all files in Google Drive trash
  2. No Recovery: Deleted files cannot be recovered after this action runs
  3. All Files: Empties entire trash - cannot select specific files to delete
  4. OAuth Security: OAuth files contain sensitive authentication credentials
  5. Network Dependency: Requires internet connection and Google Drive access
  6. API Limits: Subject to Google Drive API rate limits

Common Use Cases

Storage Management

  • Quota Issues: When Google Drive storage is full or near capacity
  • Regular Cleanup: Monthly or weekly trash cleanup procedures
  • Automated Maintenance: Scheduled cleanup after backup operations
  • Compliance: Data retention policies requiring permanent deletion

Integration Scenarios

  • Backup Systems: Clean up after backup verification completes
  • File Management: Part of larger file lifecycle management
  • System Maintenance: Regular system health and cleanup procedures
  • Storage Optimization: Maximize available Google Drive space

Monitoring and Troubleshooting

Success Indicators

  • No Errors: Action completes without authentication or API errors
  • Storage Freed: Google Drive available storage increases
  • Empty Trash: Google Drive trash shows as empty after operation
  • Completion Message: Action returns successful result

Common Issues

"OAuth authentication failed"

  • Check OAuthFile is properly authorized
  • Verify OAuth flow was completed successfully
  • Confirm Google Drive API credentials are valid
  • Check internet connectivity to Google services

"Permission denied errors"

  • Verify OAuthFile has "For Emptying Trash" permission enabled
  • Check Google Drive account permissions
  • Confirm OAuth account has access to trash operations
  • Re-authorize OAuth file if needed

"No items in trash"

  • Normal result if trash is already empty
  • Verify items were actually in trash before running
  • Check if trash was recently emptied by another process
  • Confirm you're checking the correct Google Drive account

"API rate limit exceeded"

  • Wait before retrying operation
  • Avoid running too frequently
  • Monitor Google API quota usage
  • Consider scheduling during off-peak hours

"Network connection errors"

  • Check internet connectivity
  • Verify Google Drive API is accessible
  • Check firewall settings for outbound connections
  • Monitor for Google service outages

SQL Queries for Setup Verification

-- Check OAuthFile configuration for trash emptying
SELECT code, userEmail, authorized, forDriveEmptyTrash
FROM OAuthFile 
WHERE forDriveEmptyTrash = 1 
  AND authorized = 1

-- Find OAuthFile by code/ID for verification
SELECT code, userEmail, authorized, forDriveEmptyTrash
FROM OAuthFile 
WHERE code = '[oauth-file-code]' 
   OR id = '[oauth-file-id]'

-- Monitor recent trash emptying activities (check actual table structure)
SELECT entityCode, actionClass, lastRunDate, success
FROM EntityTargetAction 
WHERE actionClass LIKE '%EAClearGoogleDriveTrash%'
ORDER BY lastRunDate DESC

Best Practices

Scheduling Recommendations

  • Frequency: Monthly or weekly depending on usage patterns
  • Timing: During off-peak hours to minimize API impact
  • After Backups: Run after backup verification is complete
  • Storage Monitoring: Schedule when approaching storage limits

Security Best Practices

  • OAuth Protection: Protect OAuth credentials like passwords
  • Account Access: Only grant minimum necessary permissions
  • Regular Review: Periodically review OAuth permissions and access
  • Audit Trail: Log when trash emptying operations are performed

Operational Guidelines

  • Verification First: Ensure items in trash are safe to delete permanently
  • Backup Verification: If cleaning backup files, verify backups are successful first
  • User Communication: Inform users before scheduled trash emptying
  • Recovery Planning: Have data recovery procedures for critical files

Safety Considerations

Before Running This Action

  1. Verify Trash Contents: Check what files are in Google Drive trash
  2. Confirm Safety: Ensure no important files are accidentally in trash
  3. Backup Verification: If deleting backup files, confirm backups are successful
  4. User Notification: Inform users about upcoming permanent deletion

Data Protection

  • Important Files: Double-check that no critical files are in trash
  • Backup Strategy: Ensure important data has alternative backups
  • Recovery Plan: Have procedures for data recovery if needed
  • Testing: Test with non-critical accounts first

Related Actions

  • EACheckDailyBackupOnGoogleDrive: Often used together for backup management
  • Google Drive Integration: Other Google Drive management actions
  • OAuth Management: Tools for managing OAuth authentication files
  • Storage Management: Other storage cleanup and management tools

API Reference

Google Drive API Used

  • Method: drive.files().emptyTrash().execute()
  • Authentication: OAuth 2.0 with Google Drive scope
  • Effect: Permanently deletes all items in trash
  • Rate Limits: Subject to Google Drive API quotas

Error Handling

  • IOException: Network or API communication errors
  • Authentication Errors: OAuth credential or permission issues
  • Rate Limiting: Google API usage quota exceeded
  • Service Errors: Google Drive service unavailable

Module: core
Full Class Name: com.namasoft.infor.domainbase.util.google.EAClearGoogleDriveTrash

Edit On github
Last Updated:: 7/23/25, 11:21 AM
Prev
EACheckDailyBackupOnGoogleDrive
Next
EACloseFiscalPeriodsInRange