Category Archives: Sql

BudgetControlProcessProc ( in SysRaiseErrorProc): Trying:exec BudgetControlCheckBudgetProc :BudgetControlCheckBudgetProc: Trying:BudgetCheckGroup XXXXXXXX was not found: at line unknown at line 67

Did you receive this error while you are deleting AP history record (AP/Inquiries/History/Invoice history and matching details) in AX2012 R2 RTM?

Message 1:

SQL error description: [Microsoft][SQL Server Native Client 10.0][SQL Server]BudgetControlProcessProc ( in SysRaiseErrorProc): Trying:exec BudgetControlCheckBudgetProc :BudgetControlCheckBudgetProc: Trying:No BudgetSource rows for BudgetCheckGroup = XXXXXXXX: at line unknown at line 67

BudgetControlProcessProc error

If yes, you can try refer to solution from AX 2012 R2: Error al eliminar Historial de facturas y coincidencias de Orden de compra. It is in Spanish language.

The solution the author provided is changing the standard class BudgetControlProcessor, this amendment should allow making the request to the BUDGETSOURCETRACKINGDETAIL table and check if you have the budget tracking information, if not find information shall not perform control of the budget document.

  1. Create method checkBudgetFix.
  2. ProcessForBudgetControl modify standard method to invoke the new method.

Note: Please remember to test in your Development environment first before applied to your Production. Try test post the invoice in Development and check the posting calculation result is correct or not.

/// <summary>
/// Invokes the stored procedure for performing the budget check.
/// </summary>
/// <returns>
///    A Boolean that indicates whether the stored procedure completed successfully.
/// </returns>
protected boolean processForBudgetControl()
{
    boolean isStoredProcedureSuccessful = true;

    // The stored procedure must be called in the case where pending deletions are prepared or return details or
    // relieving details are prepared regardless of whether there are control details to be checked
    //if (this.areProcessingDetailsPrepared()) //original
    if (this.areProcessingDetailsPrepared() && this.checkBudgetFix()) //New fix line
    //Please get the checkBudgetFix() method from original website above
    {
        isStoredProcedureSuccessful = BudgetControlProcessor::invokeBudgetCheckStoredProcedure(
            budgetCheckGroup,
            areRelievingDetailsPrepared || areRelievingPendingDeletionsPrepared);
    }

    return isStoredProcedureSuccessful;
}

Inner Join VS Cross Join

What different between INNER JOIN and CROSS JOIN for SQL?

It will has two simple scenarios.

Condition Inner Join Cross Join
No WHERE clause Return rows that equal to join columns only. It will cartesion product the join table. For eg: TableA 10 rows, TableB 20 rows, it will be 10 * 20 = 200.
With WHERE clause Return rows that equal to JOIN columns and WHERE columns. The CROSS JOIN behaves as an INNER JOIN if WHERE clause provides equal column. For eg: WHERE Table1.Key = Table2.Key.
If not, it just behaves as cartesion product.

For example, please refer to Using Cross Joins in MSDN.

Format SSRS Field according to EDT default format

How to format SSRS Field without format it manually using SSRS Expression? Just right click the SSRS textbox / Text Box Properties / Number tab / choose Custom category / Custom format / put the expression below to the textbox.

'AmountMST is the EDT
=Microsoft.Dynamics.Framework.Reports.BuiltInMethods.GetExtendedDataTypeFormat("AmountMST", Parameters!AX_RenderingCulture.Value)

Install SQLExpress using Visual Studio Installer Setup Project

How to install SQL Express using Visual Studio Installer Setup Project?

Here some hint:

  1. Use Commit node at Custom Action Editor
  2. Add a process to call batch file that will call Setup.exe for SQL Server Express.
  3. Or if you don’t want using batch file, you can create another .net application that will call setup.exe for SQL Express.

Note: You can’t directly call SQLExpress Setup.exe from Commit node at Custom Action since Setup Project not allow recursively call msi installation.

Reference: SQL Express Silent Installation with .Net Setup Custom Action

Beside that, still have other way to install SQL Express too. Examples below will install SQL Server during first time you application start.