DELETE
=======
1. Backup datamart database. i.e.: ManagementReporterDM
2. Run MR Config Console
3. Select database connection on ERP Integration
4. Disable Integration
5. Remove
6. Stop both MR Services
7. Delete Database : ManagementReporterDM
RECREATE
=========
8. Run both MR Services
9. Configure datamart
Thursday, February 23, 2017
Thursday, October 20, 2016
Run report SSRS SrsReportRunController and passing parameter from form in AX 2012 R3
void clicked()
{
Query query;
LedgerJournalTable dataTable;
SrsReportRunController controller;
;
dataTable = LedgerJournalTable;
//info(strFmt('%1',dataTable.JournalNum));
controller = new SrsReportRunController();
controller.parmReportName('MyCustomReport.PrecisionDesign1');
query = controller.parmReportContract().parmQueryContracts().lookup('MyCustomReport_DynamicParameter');
//Set parameter value;
query.dataSourceNo(1).clearRanges();
query.dataSourceNo(1).addRange(fieldNum(MyCustomReportView, JournalNum)).Value(dataTable.JournalNum);
controller.runReport();
}
Reference:
http://xhellot.blogspot.co.id/
Thursday, October 13, 2016
Reverse Settlement Accout Receivable on AX 2012 R3
static void Update_Reverse_Settlement(Args _args)
{
CustTrans invCustTrans,findCustTrans;
SpecTransManager specTransManager;
DocumentNum invdocnumx,paydocnumx;
CustSettlement custSettlement;
AccountNum accnumx;
date paydatex;
CustTable custTable;
;
invdocnumx = 'PY16100100561';
accnumx = '631331';
select invCustTrans
order by TransDate asc
where invCustTrans.DocumentNum == invdocnumx
&& invCustTrans.AmountMST > 0
&& invCustTrans.AccountNum == accnumx;
while select findCustTrans where findCustTrans.RecId == invCustTrans.RecId
{
custTable = custTable::find(findCustTrans.AccountNum);
if(findCustTrans.TransType != ledgerTransType::Payment)
{
//We must go to the customer settlement table and locate the records that were used to settle the invoice in scope and pass them into the class
// that manages the marking and updating of applied credits and payments to invoices. We remove the credit marking to remove the link between the invoice
//and the credits used to settle the invoice. Then we must reverse the transactions using the reverseTransact method on the customer transaction table
select firstonly custSettlement where custSettlement.TransCompany == findCustTrans.dataAreaId &&
custSettlement.TransRecId == findCustTrans.RecId &&
custSettlement.AccountNum == findCustTrans.AccountNum;
specTransManager = SpecTransManager::newRefTableId(custTable,tablenum(custSettlement), true);
specTransManager.insert(custSettlement.DataAreaId, custSettlement.TableId, custSettlement.RecId, custSettlement.SettleAmountCur, findCustTrans.CurrencyCode);
custSettlement.CustVendSettlement::markOffsets(specTransManager, findCustTrans.CurrencyCode, true);
if (CustTrans::reverseTransact(custTable,null,settleDatePrinc::DateOfPayment,custSettlement.TransDate))
{
specTransManager.deleteAll();
}
}
}
info(strFmt('Done %1',findCustTrans.txt));
}
Reference:
http://www.winfosoft.com/blog/uncategorized/dynamics-ax-how-to-void-an-ar-payment-and-remove-applied-credits-to-invoices-using-code
{
CustTrans invCustTrans,findCustTrans;
SpecTransManager specTransManager;
DocumentNum invdocnumx,paydocnumx;
CustSettlement custSettlement;
AccountNum accnumx;
date paydatex;
CustTable custTable;
;
invdocnumx = 'PY16100100561';
accnumx = '631331';
select invCustTrans
order by TransDate asc
where invCustTrans.DocumentNum == invdocnumx
&& invCustTrans.AmountMST > 0
&& invCustTrans.AccountNum == accnumx;
while select findCustTrans where findCustTrans.RecId == invCustTrans.RecId
{
custTable = custTable::find(findCustTrans.AccountNum);
if(findCustTrans.TransType != ledgerTransType::Payment)
{
//We must go to the customer settlement table and locate the records that were used to settle the invoice in scope and pass them into the class
// that manages the marking and updating of applied credits and payments to invoices. We remove the credit marking to remove the link between the invoice
//and the credits used to settle the invoice. Then we must reverse the transactions using the reverseTransact method on the customer transaction table
select firstonly custSettlement where custSettlement.TransCompany == findCustTrans.dataAreaId &&
custSettlement.TransRecId == findCustTrans.RecId &&
custSettlement.AccountNum == findCustTrans.AccountNum;
specTransManager = SpecTransManager::newRefTableId(custTable,tablenum(custSettlement), true);
specTransManager.insert(custSettlement.DataAreaId, custSettlement.TableId, custSettlement.RecId, custSettlement.SettleAmountCur, findCustTrans.CurrencyCode);
custSettlement.CustVendSettlement::markOffsets(specTransManager, findCustTrans.CurrencyCode, true);
if (CustTrans::reverseTransact(custTable,null,settleDatePrinc::DateOfPayment,custSettlement.TransDate))
{
specTransManager.deleteAll();
}
}
}
info(strFmt('Done %1',findCustTrans.txt));
}
Reference:
http://www.winfosoft.com/blog/uncategorized/dynamics-ax-how-to-void-an-ar-payment-and-remove-applied-credits-to-invoices-using-code
Monday, October 10, 2016
Using jumpref method on PurchReqLine on AX 2012 R3
Override method jumpRef ItemId field on Form DataSources
public void jumpRef()
{
//super();
PurchReqLine _purchRLine;
Args args;
MenuFunction menuFunction;
Common rec;
;
_purchRLine = PurchReqLine;
rec = InventTable::find(_purchRline.ItemId);
args = new Args();
args.caller(element);
args.lookupRecord();
args.record(rec);
args.caller(element);
// Create a new MenuFunction that launches the Reasons Menu Item
menuFunction = new MenuFunction(menuitemdisplaystr(EcoResProductDetailsExtended),MenuItemType::Display);
menuFunction.run(args);
}
public void jumpRef()
{
//super();
PurchReqLine _purchRLine;
Args args;
MenuFunction menuFunction;
Common rec;
;
_purchRLine = PurchReqLine;
rec = InventTable::find(_purchRline.ItemId);
args = new Args();
args.caller(element);
args.lookupRecord();
args.record(rec);
args.caller(element);
// Create a new MenuFunction that launches the Reasons Menu Item
menuFunction = new MenuFunction(menuitemdisplaystr(EcoResProductDetailsExtended),MenuItemType::Display);
menuFunction.run(args);
}
Friday, August 19, 2016
Disable Password Policy on Active Directory (Domain) Win Server 2012
Error System.IO.File::Move when using batch process on AX 2012 R3
Problem:
On syntax
You get this error when using batch process:
"System.IO.IOException: The process cannot access the file because it is being used by another process"
Cause:
Possibility
A. Your AOS services is using user which have less security access to folders.
B. You read or access files but not closed yet.
Solution:
A. Add more security access to user who run the AOS services.
B. Closing File
Step-1
Close the files before
io = new TextIO(filenameOp, "r");
io.read();
On syntax
System.IO.File::Move(fileName, newFileName);
You get this error when using batch process:
"System.IO.IOException: The process cannot access the file because it is being used by another process"
Cause:
Possibility
A. Your AOS services is using user which have less security access to folders.
B. You read or access files but not closed yet.
Solution:
A. Add more security access to user who run the AOS services.
B. Closing File
Step-1
Close the files before
CodeAccessPermission::revertAssert();
Example:
io = new TextIO(filenameOp, "r");
io.read();
.....
io.finalized;
io = null;
CodeAccessPermission::revertAssert();
Step-2
Build Generate Increament CIL
Step-3
Close and Open AX.
Tuesday, July 19, 2016
Error when configuring Management Reporter 2012 for Dynamics AX 2012 R3
Problem:
You get error message when config MR 2012:
"An unexpected error occurred while querying the Metadata service"
System.ServiceModel.FaultException`1[Microsoft.Dynamics.Performance.Deployment.DataProvider.AX.AX2012MetadataService.MetadataFault]: An exception of type MetdataException has occurred while performing the operation. (Fault Detail is equal to Microsoft.Dynamics.Performance.Deployment.DataProvider.AX.AX2012MetadataService.BatchFault).
Cause:
You add custom fields to table which is used as Financial Dimension.
e.g. You add custom fields to InventLocation, and use the table as Custom as Financial Dimension.
Solution:
Add relations to fields on the table.
Every additional fields on the table which is used to Financial Dimension must have relations.
Reference:
a. How to add table to be use on Financial Dimension:
https://dynamicsaxinsight.wordpress.com/2014/07/14/ax-2012-add-financial-dimension-for-your-table/
b. Another same problem
https://community.dynamics.com/ax/f/33/t/123925
Thank's to David Orr
You get error message when config MR 2012:
"An unexpected error occurred while querying the Metadata service"
System.ServiceModel.FaultException`1[Microsoft.Dynamics.Performance.Deployment.DataProvider.AX.AX2012MetadataService.MetadataFault]: An exception of type MetdataException has occurred while performing the operation. (Fault Detail is equal to Microsoft.Dynamics.Performance.Deployment.DataProvider.AX.AX2012MetadataService.BatchFault).
Cause:
You add custom fields to table which is used as Financial Dimension.
e.g. You add custom fields to InventLocation, and use the table as Custom as Financial Dimension.
Solution:
Add relations to fields on the table.
Every additional fields on the table which is used to Financial Dimension must have relations.
Reference:
a. How to add table to be use on Financial Dimension:
https://dynamicsaxinsight.wordpress.com/2014/07/14/ax-2012-add-financial-dimension-for-your-table/
b. Another same problem
https://community.dynamics.com/ax/f/33/t/123925
Thank's to David Orr
Subscribe to:
Posts (Atom)