Tuesday, November 17, 2015

Change-based alert functionality is not working


Issue: 
Attempts to generate Change-based alerts within AX are not functioning.

Troubleshoot steps:

Verify following things:
1. The alert rules are created
2. The changed-based alert and email batch notifications are functioning
3. Email templates and email parameters are set up.
4. Batch Job is working.

If it is still not working, then check EventCUD table.

There might be records in EventCUD table which are in waiting status with Batch GUID other than {00000000-0000-0000-0000-000000000000}

Alert process works this way:

When the alert is triggered a record is inserted into EventCUD table with {00000000-0000-0000-0000-000000000000} Batch GUID. When the Batch Job for “Change base alerts” starts it will create multiple records in EventCUD with Batch GUID other than {00000000-0000-0000-0000-000000000000} as per EventCompanyRule Table and deletes original record. In later stage, job process the new records in EventCUD and generate alerts into EventInbox table. Once the alerts are generated in EventInbox table the records from EventCUD is deleted.
If the job ends unexpectedly, it leaves orphan records in EventCUD which are not processed and they stop Change based alert from working.

Resolution:
Either delete them or update their Batch GUID {00000000-0000-0000-0000-000000000000} as required.


SSRS AX 2012: TradeDocumentReportContract Error

 Error Message ; TradeDocumentReportContract object not initialized.


Stack trace

(C)\Classes\TradeDocumentReportController\preRunModifyContract - line 11
(C)\Classes\SrsPrintMgmtController\outputReports - line 65
(C)\Classes\TradeDocumentReportController\output - line 6
(C)\Classes\SalesConfirmController\output - line 6
(C)\Classes\TradeDocumentReportController\runPrintMgmt - line 17
(C)\Classes\SrsPrintMgmtController\run - line 14
(C)\Classes\SysOperationController\startOperation - line 10
(C)\Classes\SrsReportRunController\startOperation - line 12
(C)\Classes\SrsPrintMgmtController\startOperation - line 14
(C)\Classes\SrsPrintMgmtFormLetterController\startOperation - line 14
(C)\Classes\SalesConfirmController\main - line 24
(C)\Classes\FormFunctionButtonControl\Clicked

Resolution:
1. Stop AOS.
2. Delete all the files in C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\XppIL/(Not the folders)
3. Start AOS. 
4. Try running report.( if it doesn’t work)
5. Perform a full Compile
6. Delete all the files in C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin\XppIL/Source
7. Perform a full CIL generation

Report will start working.

Tuesday, September 8, 2015

Trial Ledger Balance Error

Trial Ledger Balance Error AX 2012

Error Message:

Cannot Execute the required database operation. Cannot attach to connection since the buffer is in use. Use another buffer or clear the buffer by assigning NULL



Resolution

1. Kill all the user sessions. System Administration > online users> Select users and Kill
2. Reset Usage data. System Administration > users> options> usage data > Reset.
(All the personalization would be lost but will solve the problem)

Keywords: Trial Balance, AX 2012, Buffer size, Connection in use, Clear the buffer.


Monday, June 15, 2015

Financial Dimensions not visible for Purchase Agreement with custom user role [AX 2012]


1.       Navigate to Accounts payable/Common/Purchase orders/Purchase agreements
2.       Expand the Financial Dimensions section
a.       Note – Financial Dimensions section is missing from Header and Line Views of PA.



Header View of Purchase Agreement

Line View of Purchase Agreement

Solution:
Add Permissions to custom user role.
Go to AOT and navigate to user role. Right click on permissions node and add form PurchAgreement.
Now select the PurchAgreement node and Add control TabHeaderFinancialDimensions for header financial dimensions and TabFinancialDimensions for Lines


Synchronization Error - Failed to create session

"Failed to create a session; confirm that the user has the proper privileges to log on to Microsoft Dynamics"



In order to resolve, please check two following things:
1. Open the partitionadministration form to see how many Partitions you have:



In my case two partitions.
2. Now check number of records in USERINFO table for ‘Admin’, ‘Guest’


I found one set of records for initial partition only.

Issue:
We don’t have equal number set of admin and guest users for both partitions.


Resolution:

Delete the partition for whom users are not available from Partitions Table (Using SQL SERVER Management Studio) and then create the same partition with AX Client (System Administration>Setup>Partitions). This will create those users.

Thursday, June 11, 2015

Inventory On hand cheat list

#
Label
Description
1
Physical inventory
Total available quantities
2
Physical reserved
Quantities reserved in Sales Order
3
Available Physical
Available physical quantities for transactions
4
Ordered in total
Total quantities in open
Purchase Order
 (did not received yet)
5
Ordered reserved
Quantities reserved from Purchase Order (did not received yet)
6
Available for reservation
Quantities in open Purchase Orders
(did not received yet) available for reservation
7
On order in total
Quantity in open Sales Order
(did not delivered yet)
8
Total Available
Net available physical quantities for transaction
9
Posted quantity
Quantities posted financially
10
Deducted
Quantities have physical packing list
updates in Sales Order
11
Picked
Quantities have picking list
update in Sales Order
12
Received
Quantities have physical updates
 in Purchase Order
13
Registered
Quantities have registered
 in Purchase Order
14
Physical cost amount
Amount posted in ledger physically
15
Financial cost amount
Amount posted in leader financially
16
Cost price
Item average cost

Wednesday, June 10, 2015

Reset AUC files



The following job resets the GUID which in turn forces all clients to create a new program cache file (AX_{GLOBALGUID}*.auc). A restart of the AOS is required.


static void forceNewAUC_arb(Args _args)
{
#AiF
SysSQMSettings sysSQMSettings;
;
ttsbegin;
update_recordset sysSQMSettings setting GlobalGUID = str2Guid(#EmptyGuidString); //Updating Global GUID to Empty String.
ttscommit;
info("Restart AOS to generate a new GUID.");

}

Debugger in AX 2012

Debugger in AX 2012




     When you execute the job, it will stop at your breakpoint and it will look like the above screenshot. There are two ways of break point.


  1.        Hard coding with command.(Breakpoint;)
  2.        Using F9 or clicking on red bullet on task bar or left grey bar in X++ code editor.

   Generally it consists of 6 windows:  
   

  1.  Code: it displays the code. It looks like read only display of X++ code editor.
  2. Variables(Ctrl+Atl+V): You can find three types of variable values in this window. Locals – Shows current execution scope. Globals –  Shows Global variables values like ClassFactory, Appl and more. This –shows the class member variables
  3.  Call stack (Ctrl+Alt+C): it displays the stack of methods that were executed to reach break point.
  4.  Watch (Ctrl+Alt+W): You can add variables to watch their behavior in this window.
  5.  Breakpoints(Ctrl+Alt+B): It lists all the breakpoints which are placed in your user session.
  6.  Output(Ctrl+Alt+O):  it displays multiple outputs. Mainly used tab is infolog. Debug – Its another flavor of infolog to see messages only on debugger but not on infolog. Following code will trigger this tab. Debug::printDebug("Khalid Mohammed"); Infolog –  No explanation needed. All All other tabs:  They are optional and can be trigerred by setting preferences in Tools>Options.

   Now to main functions of debuggers:[1]


  1.   Step over (F10): Using this operation, you can execute the current line without debugging methods called by the statement if any.  
  2.   Step into (F11): Using this operation, you can step into the method called by the current line. If more than one method is called, the innermost method will have priority, then the first one to the left of the line, and then the one towards the right.
  3.   Step out (Shift+F11): Using this operation, you can step out of the current method and go back to the caller method (the previous method in the stack).
  4.   Go back: You can drag the yellow arrow to a previous line of code in the current method to go back to it. Remember that the variables will not be automatically reset to the state they had when that line was executed the first time.
  5.   Run (F5): Using this operation, you can continue the execution and jump to the next breakpoint, if any.
  6.   Run to cursor (Ctrl+F10): Using this operation, you can continue to execute and break at the line where the cursor is in the code window.
  7.   Stop debugging (Shift+F5): Using this operation, you can stop executing the code; none of the lines after the current execution position will be executed.

[1]Referred from Learning MS Dynamics AX 2012 Programming – Mohammed Rasheed

Setting up Alerts - AX 2012

Do following three steps:

1 &2:

3.Start the job in Batch Job history> Functions> Change Status > Waiting

Khalid Mohammed


Wednesday, February 11, 2015

Clear caches

Clear Caches job


static void ClearCaches_arb(Args _args)
{
    ;
    new MenuFunction(menuItemActionStr(SysFlushReportServer), MenuItemType::Action).run(); //report server
    new MenuFunction(menuItemActionStr(SysFlushDictionary), MenuItemType::Action).run(); // dictionary
    new MenuFunction(menuItemActionStr(SysFlushData), MenuItemType::Action).run(); // data
    new MenuFunction(menuItemActionStr(SysFlushAOD), MenuItemType::Action).run();// elements

}

Khalid Mohammed
Arbela Technologies