martedì 4 novembre 2014

GUIDE: Steps to correctly approach to a issue on Dynamics AX

Thanks to Denis for this very good post on his blog http://sinedax.blogspot.it/2014/10/dynamics-ax-issue-no-problem.html.

If you have an issue on Dynamics AX or a strange behavior, to resolve it, you can spend a lot of time to debug it, or first of all try to use this approach to resolve the issue. The steps are:

1-  Check if there is already a hotfix provided by Microsoft using Lifecycle Services,https://lcs.dynamics.com, especially Issue Search.
More info also on http://technet.microsoft.com/en-us/library/dn268616.aspx

2-   Search or post a question on the Microsoft Dynamics AX Community, https://community.dynamics.com/ax/f/33.aspx      Here you can work with many people that probably have already faced your issue and that can help in the right way to solve.
      Additionally, on MS AX Community you will have the pleasure to work with people that have a lot of seniority on Dynamics AX, both Technical that Functional.

3-   Raise a case on Microsoft, https://mbs2.microsoft.com/support/newstart.aspxOften, the Microsoft reply is very quick if found the issue in their internal database.
Otherwise, is needed some days just to replicate the case on their environment and provide you the relative hotfix.
Finally, you have the opportunity to help Microsoft to improve Dynamics AX and so have a product more stable for other Customers.

4-  Lastly, before debug, involve your functional colleague just to figure out if the issue can be related to a wrong setup.

5-  Finally, if you have in mind something that could improve the product, submit your suggestions using Microsoft Connect, http://connect.microsoft.com/dynamicssuggestions

martedì 14 ottobre 2014

HOWTO: Create invent marking

Here an exaple for create a mark by code:

InventTrans issueInventTrans;
TmpInventTransMark tmpInventTransMask;
Map mapMarkNow;
container con;
real qty;
Map mapTmp;
MapEnumerator mapEnumerator;

InventTransOriginId issueInventTransOriginId = 
InventTransOrigin::findByInventTransId('Issue lot ID').RecId;

InventTransOriginId receiptInventTransOriginId = 
InventTransOrigin::findByInventTransId('Receipt lot ID').RecId;    

InventQty qtyToMark = 11;

ttsBegin;

issueInventTrans = InventTrans::findByInventTransOrigin(
issueInventTransOriginId);

[con, qty] = TmpInventTransMark::packTmpMark(
InventTransOrigin::find(issueInventTransOriginId),
issueInventTrans.inventDim(), 
issueInventTrans.Qty);

mapTmp = Map::create(con);
mapEnumerator = mapTmp.getEnumerator();
while (mapEnumerator.moveNext())
{
tmpInventTransMask = mapEnumerator.currentValue();

if (tmpInventTransMask.InventTransOrigin == receiptInventTransOriginId)
{
tmpInventTransMask.QtyMarkNow = qtyToMark;
tmpInventTransMask.QtyRemain -= tmpInventTransMask.QtyMarkNow;
mapMarkNow = new Map(Types::Int64, Types::Record);
mapMarkNow.insert(tmpInventTransMask.RecId, tmpInventTransMask);

TmpInventTransMark::updateTmpMark(
issueInventTransOriginId, 
issueInventTrans.inventDim(), 
-qtyToMark,
mapMarkNow.pack());

break;
}
}

ttsCommit;

giovedì 9 ottobre 2014

TIP: Automatic open an entity when double click on the info dialog

In this case the user can double click on info dialog to go directly on the production order

info(strfmt("Production order %1 was created", prodTable.ProdId),'', SysInfoAction_TableField::newBuffer(prodTable));

HOWTO: Create transfer order by code X++

NumberSeq numberSeq;
InventTransferTable inventTransferTable;
InventTransferLine inventTransferLine;
InventDim inventDim;
;

ttsbegin;
numberSeq = NumberSeq::newGetNum(InventParameters::numRefTransferId());

inventTransferTable.clear();
inventTransferTable.initValue();
inventTransferTable.TransferId = numberSeq.num();
numberSeq.used();

inventTransferTable.InventLocationIdFrom = _inventLocationIdFrom;
inventTransferTable.modifiedField(fieldNum(InventTransferTable,InventLocationIdFrom));
inventTransferTable.InventLocationIdTo = _inventLocationIdTo;
inventTransferTable.modifiedField(fieldNum(InventTransferTable,InventLocationIdTo));
inventTransferTable.insert();

inventTransferLine.clear();
inventTransferLine.initFromInventTransferTable(inventTransferTable, NoYes::Yes);
inventTransferLine.ItemId = _itemId;
inventTransferLine.initFromInventTable(InventTable::find(_itemId));
inventTransFerLine.LineNum = InventTransferLine::lastLineNum(inventTransferTable.TransferId) + 1;
inventTransferLine.QtyTransfer = _qty;
inventTransferLine.QtyRemainReceive = _qty;
inventTransferLine.QtyRemainShip = _qty;
inventTransferLine.QtyShipNow = 0;
inventTransferLine.QtyReceiveNow = 0;
inventDim = inventTransferLine.inventDim();
inventDim.InventSiteId = InventLocation::find(inventTransferTable.InventLocationIdFrom).InventSiteId;
inventDim.InventLocationId = inventTransferTable.InventLocationIdFrom;
inventTransferLine.InventDimId = inventDim::findOrCreate(inventDim).inventDimId;
inventTransferLine.insert();
ttscommit;

giovedì 2 ottobre 2014

HOWTO: SSRS show value only on last page in body of report

If you wont to display a value only on last page use a syntax like this on field exp:

=iif(Globals!PageNumber=Globals!TotalPages,data, nothing)

If you wont to hide a control only on a last page use a syntax like this on visibility exp:

=iif(Globals!PageNumber=Globals!TotalPages,false,true)

Remember you case use Global properties only on header and footer section

mercoledì 1 ottobre 2014

HOWTO: AX 2012, How to use Date range and Enum in query value

Use this piece of code for fiter datasource beetween two date:


qbds.addRange(fieldNum(EIRTenderRecordTable, StartDate))
        .value(SysQuery::range(_requisitionDate, dateNull()));

qbds.addRange(fieldNum(EIRTenderRecordTable, EndDate))
        .value(SysQuery::range(dateNull(), _requisitionDate));

AX 2012: The request was aborted: Could not create SSL/TLS secure channel

The error you're encountering, "The request was aborted: Could not create SSL/TLS secure channel," can occur due to various re...