Overview
The CustTable is the core customer master data table in Microsoft Dynamics 365 Finance and Operations. It serves as the central repository for all customer information including contact details, payment terms, credit limits, and account settings. This table is fundamental to the Accounts Receivable module and is referenced throughout the system for customer-related transactions.
Every customer record in D365 F&O begins with an entry in CustTable, making it one of the most critical tables for businesses managing customer relationships and financial transactions. The table supports complex business scenarios including multi-currency operations, credit management, and extensive customization capabilities.
Key Fields
| Field Name | Type | Description | Required |
|---|---|---|---|
AccountNum |
CustAccount | Unique customer account identifier (primary key) | Yes |
Name |
Name | Customer name or company name | Yes |
CustGroup |
CustGroupId | Customer group classification | Yes |
Currency |
CurrencyCode | Default currency for customer transactions | Yes |
CreditMax |
CustCreditMax | Maximum credit limit allowed | No |
PaymTermId |
PaymTermId | Default payment terms | No |
Blocked |
CustVendorBlocked | Customer blocking status (No, Invoice, All, Never) | No |
Key Methods
Static Methods
Instance Methods
Common Usage Examples
Finding a Customer Record
// Find customer by account number
CustTable custTable = CustTable::find("US-001");
if (custTable.RecId)
{
info(strFmt("Customer found: %1", custTable.Name));
}
// Check if customer exists
if (CustTable::exist("US-001"))
{
// Customer exists, proceed with logic
}
Credit Limit Validation
// Check credit limit before processing order
CustTable custTable = CustTable::find("US-001");
AmountMST orderAmount = 5000.00;
if (custTable.checkCreditLimit(orderAmount))
{
// Credit limit OK, process order
info("Credit limit validation passed");
}
else
{
// Credit limit exceeded
warning("Credit limit exceeded for customer");
}
Creating a New Customer
// Create new customer record
CustTable custTable;
custTable.AccountNum = "US-100";
custTable.Name = "New Customer Corp";
custTable.CustGroup = "10";
custTable.Currency = "USD";
custTable.PaymTermId = "Net30";
if (custTable.validateWrite())
{
custTable.insert();
info("Customer created successfully");
}
Related Tables
Common Customizations
Field Extensions
- Industry-specific customer classifications
- Custom credit scoring fields
- Additional contact information fields
- Integration keys for external systems
Method Extensions
- Enhanced credit limit validation with external credit agencies
- Custom customer numbering sequences
- Workflow integration for customer approval
- Integration with CRM systems
Best Practices
- Always use find() method instead of select statements for single record retrieval
- Validate credit limits before creating sales orders or invoices
- Check blocking status before allowing transactions
- Use proper exception handling when creating or updating records
- Consider performance when querying large customer datasets
- Maintain data integrity when customizing the table structure