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

    • Search
    • Guides

      • Entity Flows
      • الفواتير والضرائب والخصومات
      • Supply Chain
      • e-commerce integration (Magento)
      • .
    • Examples
    • Reprocessing Transactions
    • Frequently Asked Questions
    • 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
        • Field Maps in Nama ERP - Complete Guide (AI-Generated by Claude.ai)
        • .
      • Accounting Module
      • AI Module
      • Contracting Module
      • CRM Module
      • EGTax Reader Module
      • Freight Management System Module
      • Hospital Management System Module
      • HR Module
      • e-commerce Integration Module
      • Manufacturing Module
      • POS Module
      • Real Estate Module
      • Service Center Module
      • Supply Chain Module
      • .
    • Release Notes

      • 2016
      • 2017
      • 2018
      • 2019
      • 2020
      • 2021
      • 2022
      • 2025
      • .
    • Video Tutorials

      • Supply Chain Videos
      • Report Wizard Videos
      • Human Resources Videos
      • .

EASortFields

This document was generated using Claude.ai

Overview

Sorts detail collections within an entity based on specified field values. Allows reordering of detail records (like invoice lines, payment details) and optionally preserves original order in a backup field before sorting.

When This Action Runs

Manual execution for organizing detail collections, improving data presentation, or preparing data for reports that require specific ordering of detail records.

How It Works

  1. Identifies detail collection - Locates the specified detail field collection in the entity
  2. Extracts sort values - Retrieves values from the specified sort field for each detail record
  3. Saves original order - Optionally stores current record positions in a backup field
  4. Applies sorting - Sorts the detail collection based on the sort field values and direction
  5. Updates collection - Reorders the detail records in the entity according to sort results

Parameters

Parameter 1: Detail Field (Required) - Name of the detail collection field to sort (e.g., "details", "lines")

Parameter 2: Sort On Field (Required) - Field within detail records to sort by (e.g., "details.item.itemCode", "paymentDetails.amount")

Parameter 3: Save Original Order In Field (Optional) - Field to store original position numbers before sorting (e.g. "details.n1")

Parameter 4: Sort Direction (Optional) - "asc" for ascending or "desc" for descending (default: "asc")

Usage Examples

Sort invoice lines by item code:

Parameter 1: details
Parameter 2: details.item.itemCode  
Parameter 3: details.n1
Parameter 4: asc

Sort payment details by amount (descending):

Parameter 1: paymentDetails
Parameter 2: paymentDetails.amount
Parameter 3: (empty)
Parameter 4: desc

Database Tables Affected

  • Detail Collection Tables - Reorders records within the specified detail collection
  • Backup Fields - Updates original position field if specified in Parameter 3

Important Warnings

⚠️ Detail Collection Requirements

  • Detail field must exist and contain a valid collection of records
  • Sort field must exist within each detail record
  • Empty collections are processed without error but no sorting occurs
  • Invalid field names will cause action failure

⚠️ Sort Field Compatibility

  • Sort field values must be comparable (strings, numbers, dates)
  • Null or empty values may cause unexpected sort results
  • Text fields are sorted alphabetically, numbers numerically

⚠️ Original Order Preservation

  • Original order is permanently lost unless backup field is specified
  • Backup field must be numeric type to store position numbers
  • Position numbers start from 1 and increment sequentially
  • Existing values in backup field are overwritten

⚠️ Data Integrity Impact

  • Reordering may affect dependent calculations that rely on record sequence
  • Business logic depending on detail order may be impacted
  • Consider implications for reports and displays that show detail records
  • Audit trails may not capture the reordering operation

⚠️ Performance Considerations

  • Large detail collections may take longer to sort
  • Complex sort fields (with calculations) may impact performance
  • Sorting is done in memory - very large collections may cause memory issues
  • Multiple sorts on same entity should be done carefully

⚠️ Field Reference Format

  • Sort field must include the detail collection prefix (e.g., "invoiceLines.amount")
  • Backup field should also include collection prefix if specified
  • Field references are case-sensitive

Module: core

Full Class Name: com.namasoft.infor.domainbase.util.actions.EASortFields

Edit On github
Last Updated:: 7/30/25, 2:51 AM
Prev
EASetFieldByTemplate
Next
EAWathqAddressFetcher