Announcements
No record found.
Hi,
I’d like to get an official clarification from Microsoft regarding a critical question that doesn’t seem to be explicitly documented anywhere.
Is it permitted to execute SQL kernel-level code within an X++ custom script deployable package for minor data correction activities in a Production environment?
I understand this approach is not recommended, but in some scenarios, converting the logic to pure X++ AOT objects results in significant performance degradation—particularly when temporary tables cannot be used (as they exist only within the original model). In such cases, a well-written and optimized SQL script can perform the operation far more efficiently.
Could you please confirm Microsoft’s official stance on this?
Thank you, Ghulam Rasool
str sqlUpdateDebit = @" UPDATE sa SET sa.DEBITACCOUNTEVENT = gjae.LEDGERDIMENSION FROM SubbillDeferralAuditTrail sa JOIN SUBBILLDEFERRALSCHEDULELINE s ON sa.SCHEDLINERECID = s.RECID JOIN LedgerJournalTrans ljt ON s.RECOGNITIONLEDGERJOURNALTRANS = ljt.RECID JOIN GENERALJOURNALENTRY gje ON gje.SUBLEDGERVOUCHER = ljt.VOUCHER JOIN GENERALJOURNALACCOUNTENTRY gjae ON gjae.GENERALJOURNALENTRY = gje.RECID WHERE gjae.ISCREDIT = 0 AND sa.SUBBILLDEFERRALAUDITTRAILEVENT = 2 AND (sa.DEBITACCOUNTEVENT IS NULL OR sa.DEBITACCOUNTEVENT = 0) AND s.SUBBILLDEFERRALSCHEDULENUMBER NOT IN (<list here>)"; updatedDebit = stmt.executeUpdateWithParameters(sqlUpdateDebit, paramMap);
// Update DebitAccountEvent while select forupdate auditTrail where auditTrail.SubbillDeferralAuditTrailEvent == 2 && auditTrail.DebitAccountEvent == 0 join s where auditTrail.SchedLineRecId == s.RecId join ljt where s.RecognitionLedgerJournalTrans == ljt.RecId join gje where gje.SubledgerVoucher == ljt.Voucher join gjae where gjae.GeneralJournalEntry == gje.RecId && !gjae.IsCredit { str schedNum = strUpr(s.SubbillDeferralScheduleNumber); if (!excludeSet.in(schedNum)) { auditTrail.DebitAccountEvent = gjae.LedgerDimension; auditTrail.update(); updatedDebit++; } }
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Giorgio Bonacorsi 617
André Arnaud de Cal... 461 Super User 2026 Season 1
Syed Haris Shah 298 Super User 2026 Season 1