- Featured Post 1 with Small Thumbnail
- Featured Post 2 with Small Thumbnail
- Featured Post 3 with Small Thumbnail
- Featured Post 4 with Small Thumbnail
Dynamics 365
Dynamics 365...More
Dynamics AX 2012
Dynamics 2012...More
Title Featured Post 3
Etiam augue pede, molestie eget, rhoncus at, convallis ut, eros...More
Title Featured Post 4
Aliquam sit amet felis. Mauris semper, velit semper laoreet dictum, quam diam dictum urna, nec placerat elit nisl in quam...More
Thursday, November 23, 2017
Wednesday, November 22, 2017
Export Import data model AXutiL
Export Import data model AXutiL :
cd C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin => letak folder untuk eksport
axutil export /model:"USR Model" /db:MicrosoftDynamicsAX_Model /file:JTC2012MOdel.axmodel
cd C:\Program Files\Microsoft Dynamics AX\60\Server\MicrosoftDynamicsAX\bin => letak folder untuk eksport
axutil export /model:"USR Model" /db:MicrosoftDynamicsAX_Model /file:JTC2012MOdel.axmodel
controller in SSRS
controller in SSRS :
protected void prePromptModifyContract()
{
#ISOCountryRegionCodes
DeliveryOrderContract contract;
TECDeliveryOrderTable TECDeliveryOrderTable;
FormDataSource fds;
str range;
;
contract = this parmReportContrat().parmRDPContract() as TECDeliveryOrderTable;
TECDeliveryOrderTable = args.record();
fds = args.record().datasource();
contract
}
How does your class look like?
Just to be sure, I'll show you a step by step
1. You create a class which extends from SrsReportRunController. Then you define a macro with the report name and the Data Contract class.
class forecastController extends SrsReportRunController
{
#define.ReportName("Report.DesignName")
forecastContract dataContract;
}
2. Next you create a main method
public static client void main(args _args)
{
forecastController controller = new forecastController();
controller.parmReportName(#ReportName);
controller.parmArgs(_args);
controller.startOperation();
}
3. Now you override the prePromptModifyContract method
protected void prePromptModifyContract()
{
args Args;
super();
Args = this.parmArgs();
dataContract = this.parmReportContract().parmRdpContract();
dataContract.parmProjid(Args.record().(fieldnum(forecastTable, Projid)));
}
4. Then you create a Menu Item and choose the Controller class as the object
5. On the form you create a new Menut Item button and set the property "CopyCallerQuery" to "Yes". Then you choose the created Menu Item as the MenuItemName for the button.
That should make it work then.
protected void prePromptModifyContract()
{
#ISOCountryRegionCodes
DeliveryOrderContract contract;
TECDeliveryOrderTable TECDeliveryOrderTable;
FormDataSource fds;
str range;
;
contract = this parmReportContrat().parmRDPContract() as TECDeliveryOrderTable;
TECDeliveryOrderTable = args.record();
fds = args.record().datasource();
contract
}
How does your class look like?
Just to be sure, I'll show you a step by step
1. You create a class which extends from SrsReportRunController. Then you define a macro with the report name and the Data Contract class.
class forecastController extends SrsReportRunController
{
#define.ReportName("Report.DesignName")
forecastContract dataContract;
}
2. Next you create a main method
public static client void main(args _args)
{
forecastController controller = new forecastController();
controller.parmReportName(#ReportName);
controller.parmArgs(_args);
controller.startOperation();
}
3. Now you override the prePromptModifyContract method
protected void prePromptModifyContract()
{
args Args;
super();
Args = this.parmArgs();
dataContract = this.parmReportContract().parmRdpContract();
dataContract.parmProjid(Args.record().(fieldnum(forecastTable, Projid)));
}
4. Then you create a Menu Item and choose the Controller class as the object
5. On the form you create a new Menut Item button and set the property "CopyCallerQuery" to "Yes". Then you choose the created Menu Item as the MenuItemName for the button.
That should make it work then.
element Args() in x++
element Args() in x++
public class ReportRun extends ObjetRun
{
PurchTable tmpPurchTable
}
Public void init()
{
super();
tmpPurchTable = element.args().record();
}
public class ReportRun extends ObjetRun
{
PurchTable tmpPurchTable
}
Public void init()
{
super();
tmpPurchTable = element.args().record();
}
Format dates in SSRS reports
Format dates in SSRS reports :
Untuk PrintDate (kalo kasih tanggal sekarang di report)
=Today()
=Format(Fields!myDate.Value, “M/d/yy”) - 2/11/08
=Format(Fields!myDate.Value, “MM/dd/yyyy”) - 02/11/2008
=Format(Fields!myDate.Value, “d-MMMM-yy”) - 11-December-08
=Format(Fields!myDate.Value, “d-MMM-yyyy”) - 11-Dec-2008 =Format(Fields!myDate.Value, “M/d/yyyy H:mm”) - 2/11/2008 13:50
=Format(Fields!myDate.Value, “MMM-dd-yyyy”) - Feb-11-2008
Untuk PrintDate (kalo kasih tanggal sekarang di report)
=Today()
=Format(Fields!myDate.Value, “M/d/yy”) - 2/11/08
=Format(Fields!myDate.Value, “MM/dd/yyyy”) - 02/11/2008
=Format(Fields!myDate.Value, “d-MMMM-yy”) - 11-December-08
=Format(Fields!myDate.Value, “d-MMM-yyyy”) - 11-Dec-2008 =Format(Fields!myDate.Value, “M/d/yyyy H:mm”) - 2/11/2008 13:50
=Format(Fields!myDate.Value, “MMM-dd-yyyy”) - Feb-11-2008
Melihat sesion DB SQL 2008
Untuk melihat sesion AOS di DB SQL Server 2008
dbo.SYSSERVERSESSIONS
dbo.SYSSERVERSESSIONS
Running Number in SSRS
Running Number in SSRS :
=RunningValue(Fields!ItemId.Value, CountDistinct, Nothing)
=RunningValue(Fields!ItemId.Value, CountDistinct, Nothing)
update_recordSet in x++
update_recordSet in x++ :
TECDOWithdrawalList DOWithdrawalList;
TECCustInOutClaimTable CustInOutClaimTable, CustInOutClaimTable2;
update_recordSet CustInOutClaimTable2
setting TECRefDOWithdrawalRecId = DOWithdrawalList.RecId,
TECRefWithdrawalId = DOWithdrawalList.TECWithdrawalId
where CustInOutClaimTable2.RecId == CustInOutClaimTable.RecId;
TECDOWithdrawalList DOWithdrawalList;
TECCustInOutClaimTable CustInOutClaimTable, CustInOutClaimTable2;
update_recordSet CustInOutClaimTable2
setting TECRefDOWithdrawalRecId = DOWithdrawalList.RecId,
TECRefWithdrawalId = DOWithdrawalList.TECWithdrawalId
where CustInOutClaimTable2.RecId == CustInOutClaimTable.RecId;
Disable Date in VirtualBox
Disable Date in VirtualBox :
Open CMD, type:
1. Cd C:\Program Files\Oracle\VirtualBox
2. vboxmanage setextradata [VMname] "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "1"
contoh :
C:\Program Files\Oracle\VirtualBox>vboxmanage setextradata "MS AX 2012R2 Contoso
" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "1"
or if you want to Turn it back on:
3. vboxmanage setextradata [VMname] "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "0"
Open CMD, type:
1. Cd C:\Program Files\Oracle\VirtualBox
2. vboxmanage setextradata [VMname] "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "1"
contoh :
C:\Program Files\Oracle\VirtualBox>vboxmanage setextradata "MS AX 2012R2 Contoso
" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "1"
or if you want to Turn it back on:
3. vboxmanage setextradata [VMname] "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" "0"
Fixing throw error datbase dynamics AX
Fixing throw error datbase dynamics AX :
• Right click on data Dictionary and synchronize the data Dictionary.
• Right click on AOT and compile it, it step take longer time. In the case of any error in any class, fix the issue and compiled.
• Generate full CIL.
• Right click on data Dictionary and synchronize the data Dictionary.
• Right click on AOT and compile it, it step take longer time. In the case of any error in any class, fix the issue and compiled.
• Generate full CIL.
init using x++
init using x++ :
public void init()
{
super();
if(element.args().record().TableId == tableNum(VendPackingSlipJour))
{
_AmbilRecordVendPackingSlipJour = element.args().record();
}
else if(element.args().record().TableId == tableNum(InventTransferParmTable))
{
_InventTransferParmTable = element.args().record();
}
}
public void init()
{
super();
if(element.args().record().TableId == tableNum(VendPackingSlipJour))
{
_AmbilRecordVendPackingSlipJour = element.args().record();
}
else if(element.args().record().TableId == tableNum(InventTransferParmTable))
{
_InventTransferParmTable = element.args().record();
}
}
Get record args with menuitem in x++
Get record args with menuitem in x++ :
Lihat Callernya !!!!
protected void afterOperationEnd()
{
//
start-dxl-ESLOG010TransferOrder-2013-05-29-01-58-pm
PurchLine purchLine;
TECTransferOrderTable
TECTransferOrderTable;
boolean updateStatus = true;
// ADD by tyo
PurchParmLine localPurchParmLine;
MenuFunction menu = new MenuFunction(menuitemOutputStr(TECProductReceipt_WithRemarkQty_auto),
MenuItemType::Output);
Args
_args = new Args();
// END by tyo
;
if
(this.purchTable().InterCompanyOrder == NoYes::Yes)
{
while
select purchLine
where
purchLine.PurchId == this.purchTable().PurchId
{
if
(purchLine.QtyOrdered != purchLine.receivedInTotalServer())
{
updateStatus = false;
break;
}
}
if
(updateStatus)
{
changecompany(this.purchTable().InterCompanyCompanyId)
{
changeCompany(SalesTable::find(this.purchTable().InterCompanyOriginalSalesId).TECTransferOrderDataAreaId)
{
update_recordSet
TECTransferOrderTable
setting TECTransferStatus =
TECTransferStatus::Received,
TECReceiptDate = systemDateGet()
where TECTransferOrderTable.TECRelationId ==
this.purchTable().InterCompanyOriginalSalesId;
}
}
}
}
//
end-dxl-ESLOG010TransferOrder-2013-05-29-01-58-pm
//start-BGS-EDD
Indent Order
//SalesLine::updateIndentOrderStatusPO(this.purchTable().PurchId);
//end-BGS-EDD
Indent Order
// Add By Tyo
select
localPurchParmLine where
localPurchParmLine.ParmId == this.parmId();
if(tidPrintProductReceipt
&& localPurchParmLine)
{
_args.record(localPurchParmLine);
menu.run(_args);
}
// End By
Tyo
super();
}
More Than 2 Remote Desktop Sessions
More
Than 2 Remote Desktop Sessions :
Pada server ketik command
promtgpedit.msc> computer configuration > Administrative Template >
Windows Component > Remote Desktop Service > Remote Desktop Session Host
> Connection.
ganti jadi
Disable
Buka Remote Desktop Session Host Configuration
Klik kanan RDP-Tcp> Network Adapter, kemudian ganti
maximum connection sesuai kebutuhan.
Buka server manager, kemudian tambah role untuk remote desktop
Add role >tambahkan role remote desktop
Next…next kemudian restart
Relation Custtable and CustInvoiceJour in x++
Relation Custtable and CustInvoiceJour in x++ :
select _CustTable where _CustTable.AccountNum == CustInvoiceJour.SalesId;
.:: Atau methode ini sudah disediakan di table CustInvoiceJour ::.
CustInvoiceJour.custTable_OrderAccount();
select _CustTable where _CustTable.AccountNum == CustInvoiceJour.SalesId;
.:: Atau methode ini sudah disediakan di table CustInvoiceJour ::.
CustInvoiceJour.custTable_OrderAccount();
Calling report using menu item (args.record(namatable)) in x++
Calling report using menu item (args.record(namatable)) in x++ :
void clicked()
{
InventJournalTable inventJournalTable;
InventJournalTrans inventJournalTrans;
InventDim localInventDim;
CustInvoiceTrans custInvoiceTrans;
TECCustInOutClaimTable localTECCustInOutClaimTable;
TECCustInOutClaimLine localTECCustInOutClaimLine, CustInOutClaimLine;
RetailTransactionSalesTrans retailTransactionSalesTrans;
InventJournalCheckPost journalCheckPost;
Args args = new Args();
;
super();
TECCustInOutClaimLine_ds.write();
select firstOnly inventJournalTable
where inventJournalTable.TECCustInClaimLineRefRecId == TECCustInOutClaimLine.RecId;
if (!inventJournalTable)
{
inventJournalTable.clear();
inventJournalTable.initFromInventJournalName(InventJournalName::find(InventParameters::find().TECCustInClaimJournalNameId));
inventJournalTable.insert();
select firstOnly localTECCustInOutClaimTable
where localTECCustInOutClaimTable.RecId == TECCustInOutClaimLine.TECCustInOutClaimTableRefRecId;
select firstOnly retailTransactionSalesTrans
where retailTransactionSalesTrans.receiptId == localTECCustInOutClaimTable.RetailReceiptId
&& retailTransactionSalesTrans.ItemId == TECCustInOutClaimLine.ItemId;
localInventDim.clear();
// localInventDim.InventSiteId = custInvoiceTrans.inventSiteId();
// localInventDim.InventLocationId = custInvoiceTrans.inventLocationId();
// localInventDim.inventDimId = retailTransactionSalesTrans.inventDimId;
// localInventDim = InventDim::findOrCreate(localInventDim);
while select CustInOutClaimLine
where CustInOutClaimLine.TECCustInOutClaimTableRefRecId == TECCustInOutClaimLine.TECCustInOutClaimTableRefRecId
{
ttsBegin;
inventJournalTrans.clear();
inventJournalTrans.initFromInventJournalTable(inventJournalTable);
inventJournalTrans.TransDate = systemDateGet();
inventJournalTrans.initFromInventTable(InventTable::find(CustInOutClaimLine.ItemId));
inventJournalTrans.InventDimId = InventDim.inventDimId;
inventJournalTrans.Qty = TECCustInOutClaimLine.SalesQty;
inventJournalTrans.CostPrice = retailTransactionSalesTrans.price;
inventJournalTrans.CostAmount = inventJournalTrans.Qty * inventJournalTrans.CostPrice;
inventJournalTrans.DefaultDimension = getNewDefaultDimensionTEC(InventTable::find(CustInOutClaimLine.ItemId).DefaultDimension, "1. STORE", StorageDimensions_InventLocationId.valueStr());
inventJournalTrans.insert();
ttsCommit;
}
info(strFmt('Claim in movement journal: %1 has been created.', inventJournalTable.JournalId));
while select forUpdate localTECCustInOutClaimLine
//where localTECCustInOutClaimLine.TECCustInOutClaimTableRefRecId == TECCustInOutClaimLine.TECCustInOutClaimTableRefRecId
where localTECCustInOutClaimLine.RecId == TECCustInOutClaimLine.RecId
{
ttsBegin;
localTECCustInOutClaimLine.ClaimInJournalId = inventJournalTable.JournalId;
localTECCustInOutClaimLine.TECClaimInStatus = TECClaimInStatus::Received;
// add by Tyo -(79 OPERATION - Sales return, Trade In dan Claim supplier In: - Harus ada siapa yang terima di gudang)
localTECCustInOutClaimLine.TIDReceiptPerson = curUserId();
// end by Tyo
localTECCustInOutClaimLine.update();
ttsCommit;
}
}
if (inventJournalTable.Posted == NoYes::No)
{
journalCheckPost = new InventJournalCheckPost();
if (InventJournalCheckPost::newPostJournal(inventJournalTable).validate())
InventJournalCheckPost::newPostJournal(inventJournalTable).run();
info(strFmt('Claim in movement journal: %1 has been posted.', inventJournalTable.JournalId));
}
if (TECCustInOutClaimLine.IsDelivery == NoYes::Yes)
{
element.PostDOWithdrawal(inventJournalTable.JournalId);
}
TECCustInOutClaimLine_ds.executeQuery();
//args.record(inventJournalTable);
//new MenuFunction(MenuItemDisplayStr(CustFreeInvoice), MenuItemType::Display).run(args);
// add by tyo - create picking list report
args.record(TECCustInOutClaimLine);
new MenuFunction(menuitemOutputStr(TECPickingList), MenuItemType::Output).run(Args);
// end by tyo - create picking list report
}
{
InventJournalTable inventJournalTable;
InventJournalTrans inventJournalTrans;
InventDim localInventDim;
CustInvoiceTrans custInvoiceTrans;
TECCustInOutClaimTable localTECCustInOutClaimTable;
TECCustInOutClaimLine localTECCustInOutClaimLine, CustInOutClaimLine;
RetailTransactionSalesTrans retailTransactionSalesTrans;
InventJournalCheckPost journalCheckPost;
Args args = new Args();
;
super();
TECCustInOutClaimLine_ds.write();
select firstOnly inventJournalTable
where inventJournalTable.TECCustInClaimLineRefRecId == TECCustInOutClaimLine.RecId;
if (!inventJournalTable)
{
inventJournalTable.clear();
inventJournalTable.initFromInventJournalName(InventJournalName::find(InventParameters::find().TECCustInClaimJournalNameId));
inventJournalTable.insert();
select firstOnly localTECCustInOutClaimTable
where localTECCustInOutClaimTable.RecId == TECCustInOutClaimLine.TECCustInOutClaimTableRefRecId;
select firstOnly retailTransactionSalesTrans
where retailTransactionSalesTrans.receiptId == localTECCustInOutClaimTable.RetailReceiptId
&& retailTransactionSalesTrans.ItemId == TECCustInOutClaimLine.ItemId;
localInventDim.clear();
// localInventDim.InventSiteId = custInvoiceTrans.inventSiteId();
// localInventDim.InventLocationId = custInvoiceTrans.inventLocationId();
// localInventDim.inventDimId = retailTransactionSalesTrans.inventDimId;
// localInventDim = InventDim::findOrCreate(localInventDim);
while select CustInOutClaimLine
where CustInOutClaimLine.TECCustInOutClaimTableRefRecId == TECCustInOutClaimLine.TECCustInOutClaimTableRefRecId
{
ttsBegin;
inventJournalTrans.clear();
inventJournalTrans.initFromInventJournalTable(inventJournalTable);
inventJournalTrans.TransDate = systemDateGet();
inventJournalTrans.initFromInventTable(InventTable::find(CustInOutClaimLine.ItemId));
inventJournalTrans.InventDimId = InventDim.inventDimId;
inventJournalTrans.Qty = TECCustInOutClaimLine.SalesQty;
inventJournalTrans.CostPrice = retailTransactionSalesTrans.price;
inventJournalTrans.CostAmount = inventJournalTrans.Qty * inventJournalTrans.CostPrice;
inventJournalTrans.DefaultDimension = getNewDefaultDimensionTEC(InventTable::find(CustInOutClaimLine.ItemId).DefaultDimension, "1. STORE", StorageDimensions_InventLocationId.valueStr());
inventJournalTrans.insert();
ttsCommit;
}
info(strFmt('Claim in movement journal: %1 has been created.', inventJournalTable.JournalId));
while select forUpdate localTECCustInOutClaimLine
//where localTECCustInOutClaimLine.TECCustInOutClaimTableRefRecId == TECCustInOutClaimLine.TECCustInOutClaimTableRefRecId
where localTECCustInOutClaimLine.RecId == TECCustInOutClaimLine.RecId
{
ttsBegin;
localTECCustInOutClaimLine.ClaimInJournalId = inventJournalTable.JournalId;
localTECCustInOutClaimLine.TECClaimInStatus = TECClaimInStatus::Received;
// add by Tyo -(79 OPERATION - Sales return, Trade In dan Claim supplier In: - Harus ada siapa yang terima di gudang)
localTECCustInOutClaimLine.TIDReceiptPerson = curUserId();
// end by Tyo
localTECCustInOutClaimLine.update();
ttsCommit;
}
}
if (inventJournalTable.Posted == NoYes::No)
{
journalCheckPost = new InventJournalCheckPost();
if (InventJournalCheckPost::newPostJournal(inventJournalTable).validate())
InventJournalCheckPost::newPostJournal(inventJournalTable).run();
info(strFmt('Claim in movement journal: %1 has been posted.', inventJournalTable.JournalId));
}
if (TECCustInOutClaimLine.IsDelivery == NoYes::Yes)
{
element.PostDOWithdrawal(inventJournalTable.JournalId);
}
TECCustInOutClaimLine_ds.executeQuery();
//args.record(inventJournalTable);
//new MenuFunction(MenuItemDisplayStr(CustFreeInvoice), MenuItemType::Display).run(args);
// add by tyo - create picking list report
args.record(TECCustInOutClaimLine);
new MenuFunction(menuitemOutputStr(TECPickingList), MenuItemType::Output).run(Args);
// end by tyo - create picking list report
}
Print Barcode Code using x++
Print Barcode Code using x++ :
void clicked()
{
//AIFD_PrintBarcode
AI_PrintBarcodeController aiBarcode = new AI_PrintBarcodeController();
AI_PrintBarcodeContract aiContract = new AI_PrintBarcodeContract();
ProdJournalProd prodJournalProdLoc;
SRSPrintDestinationSettings printSettings = new SRSPrintDestinationSettings();
PrintJobSettings printJobSettings = new PrintJobSettings();
Dialog dialog = new Dialog();
DialogField dialogFileName;
str adobeExe;
str adobeParm;
str fileName;
int fileCount;
//AIFD
InteropPermission permission;
str errorMessage;
//END
real WeightInreal;
permission = new InteropPermission(InteropKind::ClrInterop);
permission.assert();
super();
try
{
prodJournalProdLoc = ProdJournalProd_ds.getFirst(true);
while (prodJournalProdLoc)
{
fileCount++;
aiBarcode.parmReportName(ssrsReportStr(AI_PrintBarcoderReport,Report));
aiBarcode.parmShowDialog(false);
aiContract.parmRecordId(prodJournalProdLoc.RecId);
aiContract.parmDocumentTitle("x");
//printSettings = aiBarcode.parmReportContract().parmPrintSettings();
printSettings.printMediumType(SRSPrintMediumType::File);
//printSettings.landscape(false);
//printSettings.printerPageSettings('KRRLabelBarcode');
//info(strFmt("%1",printSettings.printerPageSettings()));
fileName = strFmt("D:\\barcode%1.pdf",fileCount);
printSettings.fileFormat(SRSReportFileFormat::PDF);
printSettings.fileName(fileName);
printSettings.printerName("TOSHIBA B-SA4TP TS");
printSettings.landscape(false);
printSettings.overwriteFile(true);
aiBarcode.parmReportContract().parmRdpContract(aiContract);
aiBarcode.parmReportContract().parmPrintSettings(printSettings);
aiBarcode.startOperation();
WeightInReal = sleep(500);
//printJobSettings.printerSettings('SysPrintForm');
printJobSettings.setTarget(PrintMedium::Printer);
printJobSettings.preferredTarget(PrintMedium::Printer);
adobeExe = WinAPI::findExecutable(fileName);
adobeParm = strFmt(' /t "%1" "%2" "%3" "%4"',
fileName,
"TOSHIBA B-SA4TP TS",
printJobSettings.printerDriverName(),
printJobSettings.printerPortName());
winAPI::shellExecute(adobeExe, adobeParm);
WeightInReal = sleep(500);
prodJournalProdLoc = ProdJournalProd_ds.getNext();
}
CodeAccessPermission::revertAssert();
}
catch(Exception::CLRError)
{
errorMessage = AifUtil::getClrErrorMessage();
CodeAccessPermission::revertAssert();
throw error(errorMessage);
}
//END
}
void clicked()
{
//AIFD_PrintBarcode
AI_PrintBarcodeController aiBarcode = new AI_PrintBarcodeController();
AI_PrintBarcodeContract aiContract = new AI_PrintBarcodeContract();
ProdJournalProd prodJournalProdLoc;
SRSPrintDestinationSettings printSettings = new SRSPrintDestinationSettings();
PrintJobSettings printJobSettings = new PrintJobSettings();
Dialog dialog = new Dialog();
DialogField dialogFileName;
str adobeExe;
str adobeParm;
str fileName;
int fileCount;
//AIFD
InteropPermission permission;
str errorMessage;
//END
real WeightInreal;
permission = new InteropPermission(InteropKind::ClrInterop);
permission.assert();
super();
try
{
prodJournalProdLoc = ProdJournalProd_ds.getFirst(true);
while (prodJournalProdLoc)
{
fileCount++;
aiBarcode.parmReportName(ssrsReportStr(AI_PrintBarcoderReport,Report));
aiBarcode.parmShowDialog(false);
aiContract.parmRecordId(prodJournalProdLoc.RecId);
aiContract.parmDocumentTitle("x");
//printSettings = aiBarcode.parmReportContract().parmPrintSettings();
printSettings.printMediumType(SRSPrintMediumType::File);
//printSettings.landscape(false);
//printSettings.printerPageSettings('KRRLabelBarcode');
//info(strFmt("%1",printSettings.printerPageSettings()));
fileName = strFmt("D:\\barcode%1.pdf",fileCount);
printSettings.fileFormat(SRSReportFileFormat::PDF);
printSettings.fileName(fileName);
printSettings.printerName("TOSHIBA B-SA4TP TS");
printSettings.landscape(false);
printSettings.overwriteFile(true);
aiBarcode.parmReportContract().parmRdpContract(aiContract);
aiBarcode.parmReportContract().parmPrintSettings(printSettings);
aiBarcode.startOperation();
WeightInReal = sleep(500);
//printJobSettings.printerSettings('SysPrintForm');
printJobSettings.setTarget(PrintMedium::Printer);
printJobSettings.preferredTarget(PrintMedium::Printer);
adobeExe = WinAPI::findExecutable(fileName);
adobeParm = strFmt(' /t "%1" "%2" "%3" "%4"',
fileName,
"TOSHIBA B-SA4TP TS",
printJobSettings.printerDriverName(),
printJobSettings.printerPortName());
winAPI::shellExecute(adobeExe, adobeParm);
WeightInReal = sleep(500);
prodJournalProdLoc = ProdJournalProd_ds.getNext();
}
CodeAccessPermission::revertAssert();
}
catch(Exception::CLRError)
{
errorMessage = AifUtil::getClrErrorMessage();
CodeAccessPermission::revertAssert();
throw error(errorMessage);
}
//END
}
What is the difference between AmountCur and AmountMst in Dynamics AX
What is the difference between AmountCur and AmountMst in Dynamics AX :
What is the difference between AmountCur and AmountMst in Dynamics AX?
AmountCur is the amount in the entered currency
and AmountMST is the amount in the base currency for the company
What is the difference between AmountCur and AmountMst in Dynamics AX?
AmountCur is the amount in the entered currency
and AmountMST is the amount in the base currency for the company
Jika EP AX2012R3 tidak bisa dibuka di dalam VM itu sendiri
Jika EP AX2012R3 tidak bisa dibuka di dalam VM itu sendiri :
Jika VM AX2012R3 tidak bisa membuka web portal AX, maka kita
perlu mendaftarkan alamat Enterprise portal yang ada di AX (System
Administrator -> Setup -> Enterprise Portal -> Website), ke dalam
folder hosts (Windows -> System32 -> drivers -> etc).
Untuk ambil data dengan methode menggunakan find dengan x++
Untuk ambil data dengan methode menggunakan find dengan x++ :
_BuyBackGuaranteeTMP.CustomerId
= SalesTable::find(_TECBuyBGuaranteeTable.SalesId).CustAccount;
contoh
:
Saya
mau ambil CustAccount dari table SalesTable
1. _BuyBackGuaranteeTMP
adalah Table Temporary
2. CustomerId
adalah variabel yang ingin dimunculkan di Dataset
3. SalesTable
adalah tabel yang menyimpan field CustAccount
4. Find
adalah methodenya
5. _TECBuyBGuaranteeTable
adalah Table Master yang mempunyai relasi dengan SalesTable (tergantung methode yg ada di salestable juga
kaleeee....)
6. SalesId
adalah field yang menghubungan antara _TECBuyBGuarantee dengan SalesTable
7. CustAccount
adalah field tujuan yang ingin diambil
Yang
hendak diambil dari TECBuyBackGuarantee adalah Customer Account yang berasal
dari tabel SalesTable.
_BuyBackGuaranteeTMP.CustomerID = SalesTable::find(_TECBuyBGuaranteeTable.Salesid).CustAccount;
atau
:
_BuyBackGuaranteeTMP.
CustomerID = Select Salestable where Salestable.Salesid ==
_TECBuyBGuaranteeTable.Salesid;
SystemdateGet Print date regarding server or Today
SystemdateGet Print date regarding server or Today :
display str TglCetak()
{
//return strFmt('Tgl. Cetak : %1', DateTimeUtil::getSystemDateTime());
return strFmt('Tgl. Cetak : %1', systemDateGet());
//return strFmt('Tgl. Cetak :%1', today
}
display str TglCetak()
{
//return strFmt('Tgl. Cetak : %1', DateTimeUtil::getSystemDateTime());
return strFmt('Tgl. Cetak : %1', systemDateGet());
//return strFmt('Tgl. Cetak :%1', today
}
Change automatic change next page using x++
Change automatic change next page using x++ :
if(nourut == 10)
{
element.newPage();
}
if(nourut == 10)
{
element.newPage();
}
find phone using x++
Find phone using x++ :
static void Job10(Args _args)
{
VendTable vnd;
;
vnd = VendTable::find("V-00000");
info(vnd.phone());
info(vnd.telefax());
}
static void Job10(Args _args)
{
VendTable vnd;
;
vnd = VendTable::find("V-00000");
info(vnd.phone());
info(vnd.telefax());
}
Public Void with parameter using x++
Public Void with parameter using x++ :
public void addData(TransDate fromDate, TransDate
toDate,
InventLocationId warehouse,
RefRecId planVersionId)
{
TIDBOB BOB, BOB2;
TIDBOBTmp BOBTmp;
InventDim inventDim;
ItemId tmpItemId;
TransDate date1, date2;
str datetmp1, datetmp2;
int m, y;
;
m = mthOfYr(fromDate);
m = m - 1;
y = year(fromDate);
if (m == 0)
{
m = 12;
y = y - 1;
}
datetmp1 = int2str(m)+'/25/'+int2str(y);
date1 = str2Date(datetmp1, 213);
date2 = dateEndMth(date1);
inventDim.InventLocationId =
warehouse;
inventDim.InventSiteId =
InventLocation::find(warehouse).InventSiteId;
inventDim =
InventDim::findOrCreate(inventDim);
if (warehouse != '')
{
while
select BOB order by
BOB.ItemId
where
BOB.ReqDateDlv >= dateStartMth(fromDate)
&& BOB.ReqDateDlv <=
dateEndMth(toDate)
&& BOB.InventLocationId
== warehouse
&& BOB.PlanVersionid ==
planVersionId
{
if
(tmpItemId == BOB.ItemId) || !tmpItemId)
{
this.PrintDate = dateStartMth(fromDate);
this.InventLocationId = warehouse;
this.ItemId = BOB.ItemId;
this.UnitId =
InventTable::find(BOB.ItemId).inventUnitId();
this.CreateDate = BOB.CreateDate;
this.PlanVersionId = BOB.PlanVersionid;
if
(dayOfMth(BOB.ReqDateDlv) >= 1 && dayOfMth(BOB.ReqDateDlv)
<= 5)
{
this.qtyperiode1 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 6 && dayOfMth(BOB.ReqDateDlv)
<= 10)
{
this.qtyperiode2 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 11 && dayOfMth(BOB.ReqDateDlv)
<= 15)
{
this.qtyperiode3 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 16 && dayOfMth(BOB.ReqDateDlv)
<= 20)
{
this.qtyperiode4 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 21 && dayOfMth(BOB.ReqDateDlv)
<= 25)
{
this.qtyperiode5 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 26 && dayOfMth(BOB.ReqDateDlv)
<= 31)
{
this.qtyperiode6 +=
BOB.Qty;
}
}
else
{
this.insert();
this.PrintDate = dateStartMth(fromDate);
this.InventLocationId = warehouse;
this.ItemId = BOB.ItemId;
this.UnitId =
InventTable::find(BOB.ItemId).inventUnitId();
this.CreateDate = BOB.CreateDate;
this.PlanVersionId = BOB.PlanVersionid;
this.qtyperiode1 = 0;
this.qtyperiode2 = 0;
this.qtyperiode3 = 0;
this.qtyperiode4 = 0;
this.qtyperiode5 = 0;
this.qtyperiode6 = 0;
if
(dayOfMth(BOB.ReqDateDlv) >= 1 && dayOfMth(BOB.ReqDateDlv)
<= 5)
{
this.qtyperiode1 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 6 && dayOfMth(BOB.ReqDateDlv)
<= 10)
{
this.qtyperiode2 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 11 && dayOfMth(BOB.ReqDateDlv)
<= 15)
{
this.qtyperiode3 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 16 && dayOfMth(BOB.ReqDateDlv)
<= 20)
{
this.qtyperiode4 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 21 && dayOfMth(BOB.ReqDateDlv)
<= 25)
{
this.qtyperiode5 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 26 && dayOfMth(BOB.ReqDateDlv)
<= 31)
{
this.qtyperiode6 +=
BOB.Qty;
}
//
Menambahkan quantity period terakhir 1 bulan sebelumnya
select
sum(Qty) from
BOB2
where
BOB2.ReqDateDlv >= date1
&&
BOB2.ReqDateDlv <= date2
&&
BOB2.InventLocationId == warehouse
&& BOB2.ItemId
== tmpItemId;
update_recordSet
BOBTmp
setting qtyperiode0 = BOB2.qty
where BOBTmp.ItemId == tmpItemId;
}
tmpItemId = BOB.ItemId;
}
this.insert();
//
Menambahkan quantity period terakhir 1 bulan sebelumnya
select
sum(Qty) from
BOB2
where
BOB2.ReqDateDlv >= date1
&&
BOB2.ReqDateDlv <= date2
&&
BOB2.InventLocationId == warehouse
&& BOB2.ItemId
== tmpItemId;
update_recordSet
BOBTmp
setting qtyperiode0 = BOB2.qty
where BOBTmp.ItemId == tmpItemId;
}
else
{
while
select BOB order by
BOB.ItemId
where
BOB.ReqDateDlv >= dateStartMth(fromDate)
&& BOB.ReqDateDlv <=
dateEndMth(toDate)
{
if
(tmpItemId == BOB.ItemId || !tmpItemId)
{
this.PrintDate = dateStartMth(fromDate);
this.InventLocationId = warehouse;
this.ItemId = BOB.ItemId;
this.UnitId =
InventTable::find(BOB.ItemId).inventUnitId();
this.CreateDate = BOB.CreateDate;
if (dayOfMth(BOB.ReqDateDlv)
>= 1 && dayOfMth(BOB.ReqDateDlv) <= 5)
{
this.qtyperiode1 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 6 && dayOfMth(BOB.ReqDateDlv)
<= 10)
{
this.qtyperiode2 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 11 && dayOfMth(BOB.ReqDateDlv)
<= 15)
{
this.qtyperiode3 +=
BOB.Qty;
}
if (dayOfMth(BOB.ReqDateDlv) >= 16 && dayOfMth(BOB.ReqDateDlv)
<= 20)
{
this.qtyperiode4 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 21 && dayOfMth(BOB.ReqDateDlv)
<= 25)
{
this.qtyperiode5 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 26 && dayOfMth(BOB.ReqDateDlv)
<= 31)
{
this.qtyperiode6 +=
BOB.Qty;
}
}
else
{
this.insert();
this.PrintDate = dateStartMth(fromDate);
this.InventLocationId = warehouse;
this.ItemId = BOB.ItemId;
this.UnitId =
InventTable::find(BOB.ItemId).inventUnitId();
this.CreateDate = BOB.CreateDate;
this.qtyperiode1 = 0;
this.qtyperiode2 = 0;
this.qtyperiode3 = 0;
this.qtyperiode4 = 0;
this.qtyperiode5 = 0;
this.qtyperiode6 = 0;
if
(dayOfMth(BOB.ReqDateDlv) >= 1 && dayOfMth(BOB.ReqDateDlv)
<= 5)
{
this.qtyperiode1 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 6 && dayOfMth(BOB.ReqDateDlv)
<= 10)
{
this.qtyperiode2 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 11 && dayOfMth(BOB.ReqDateDlv)
<= 15)
{
this.qtyperiode3 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 16 && dayOfMth(BOB.ReqDateDlv)
<= 20)
{
this.qtyperiode4 +=
BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 21 && dayOfMth(BOB.ReqDateDlv)
<= 25)
{
this.qtyperiode5 += BOB.Qty;
}
if
(dayOfMth(BOB.ReqDateDlv) >= 26 && dayOfMth(BOB.ReqDateDlv)
<= 31)
{
this.qtyperiode6 +=
BOB.Qty;
}
//
Menambahkan quantity period terakhir 1 bulan sebelumnya
select
sum(Qty) from
BOB2
where
BOB2.ReqDateDlv >= date1
&&
BOB2.ReqDateDlv <= date2
&&
BOB2.InventLocationId == warehouse
&& BOB2.ItemId
== tmpItemId;
update_recordSet
BOBTmp
setting qtyperiode0 = BOB2.qty
where BOBTmp.ItemId == tmpItemId;
}
tmpItemId = BOB.ItemId;
}
this.insert();
//
Menambahkan quantity period terakhir 1 bulan sebelumnya
select
sum(Qty) from
BOB2
where
BOB2.ReqDateDlv >= date1
&&
BOB2.ReqDateDlv <= date2
&& BOB2.InventLocationId
== warehouse
&& BOB2.ItemId
== tmpItemId;
update_recordSet
BOBTmp
setting qtyperiode0 = BOB2.qty
where BOBTmp.ItemId == tmpItemId;
}
}
Subscribe to:
Posts (Atom)
A financial dimension value is based on the record and has been used on a transaction. You cannot delete the record
SOLUTION delete in table DimensionAttributeLevelValue base on Bank Account : and Delete the Bank Account FINISH