AX 2012: How to enable or disable execute business operation in CIL using X++

Hi Readers,

Today, in this post we are going to tell you a very important topic about execute business operation in CIL, you can enable or disable execute business operation in CIL using X++.



Copy the below code and paste it in AX job using AOT.

// Created By: Chirag Gupta
// Created Date: 27-Dec-2019
// Summary: This job code will be used for enable/disable 'Execute business operation in CIL' checkbox.
static void PKA_SetCILExecution(Args _args)
{
    #LOCALMACRO.FLAG_ExecBusinessOpsWithInterpreter (1 << 10) #ENDMACRO

    UserInfo            userInfo;
    // setEnable = false; To disable Execute business operation in CIL
    // setEnable = true; To enable Execute business operation in CIL
    boolean             setEnabled = false;

    ttsBegin;

    while select forUpdate DebugInfo from userInfo
        where userInfo.accountType  == UserAccountType::ADUser
            && userInfo.enable      == NoYes::Yes
            //&& userInfo.id          == 'abhishek' // Uncomment it for filter by user id
            //&& userInfo.company     == 'FRK' // Uncomment it for filter by Company
    {
        if (setEnabled)
        {
            userInfo.DebugInfo  = userInfo.DebugInfo ^ #FLAG_ExecBusinessOpsWithInterpreter;
        }
        else
        {
            userInfo.DebugInfo  = userInfo.DebugInfo | #FLAG_ExecBusinessOpsWithInterpreter;
        }
        userInfo.update();
    }

    ttsCommit;

    info("Done");
}

Note: You can changes your values according to your requirement.

Author:
Chirag Gupta
Microsoft Dynamics 365 AX Technical Consultant at IBM Bangalore

Date:
27-Dec-2019

Happy Learning !!

Comments

  1. Ax 2012: How To Enable Or Disable Execute Business Operation In Cil Using X++ >>>>> Download Now

    >>>>> Download Full

    Ax 2012: How To Enable Or Disable Execute Business Operation In Cil Using X++ >>>>> Download LINK

    >>>>> Download Now

    Ax 2012: How To Enable Or Disable Execute Business Operation In Cil Using X++ >>>>> Download Full

    >>>>> Download LINK En

    ReplyDelete

Post a Comment

Popular posts from this blog

[Solved] : Error: String or binary data would be truncated. Cannot execute a data definition language command on Vendor (VendLedgerReconciliationTmp)

AX 2012 - Command prompt compilation / AxBuild.exe for Parallel Compile on AOS of X++ to P-code / Parallel Compilation

AX 2012 - How to send SSRS report in email as an attachment using X++

AX 2012 - How to stop AOS when services got stuck at stopping status

AX 2012 - How to make a form field mandatory

Error: There was no endpoint listening at net.tcp://your_server_name:8201/Dynamics AX/Services…

Fetch vendor address using X++ in AX 2012

AX 2012 - How to print current date and time on SSRS Report

[Error] - Error in unit of amount in currency KES. Must be rounded to 0.01 | The unit of 37.563.5343100000000000 KES being posted to account 32710001-- is outside the current penny rounding threshold | Posting has been canceled

[Solved] : AX 2012 - No connection could be made because the target machine actively refused it 192.168.10.249:8201