validate_best_practices
Run an in-house best-practice audit on any AOT object (custom or standard), from the indexed source -- NOT the Microsoft BP checker. Rules are this server's own: SEC (security chain), PERF (firstOnly, set-based, N+1), TXN (ttsbegin/ttscommit pairing), ERR (error handling), COC (next() vs super()), QUAL, DATA (EDT on fields), CONV (naming, ISV prefix) and CLOUD. It runs pre-compile and needs no D365 install, so it catches things while the code is being written -- but it does not replace xppbp.exe, whose rule set and monikers are different. For the authoritative Microsoft verdict run run_best_practices_check (xppc.exe -BestPractices, whole model) or run_best_practices_check_scoped (xppbp.exe, one object). Returns violation table: severity (Critical/Warning), rule ID, code snippet, fix instruction. For deep N+1 / row-by-row performance profiling use detect_performance_issues instead. [!] Auto-fixing Critical violations requires D365_CUSTOM_MODEL_PATH (custom code only).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| methodName | No | Optional: specific method to validate. Validates all methods if not provided. | |
| objectName | Yes | Object name to validate, e.g. 'SalesTable', 'CustInvoiceJour' | |
| minSeverity | No | Minimum severity: 'Info', 'Warning', 'Critical' (default: 'Warning') | Warning |