you can add value with this function :
(dayRange(-60,60))
-60 = today -60
60 = today + 60 day
Selasa, 31 Mei 2016
AX :Using Methods in Table Filters & Query Ranges in Dynamics AX 2012 (http://nuxulu.com)
In Dynamics AX, there is a class called SysQueryRangeUtil
that can be utilized in both query ranges and table filters. Using
methods from this class allow you to be very precise about what dates
you want to use in reports or for filtering your data.
Let’s say you have a report that you always
want to run to see orders with shipping dates of the next day. It is
possible to do so by using one of the methods from the SysQueryRangeUtil. The
use of the letter ‘t’ will work for today’s date, but when you try to
add days to it, it doesn’t work in reports. Instead, I will use the currentdate() method and add 1 to it.
Note: All methods & expressions must be surrounded by parentheses as shown below.
Note: All methods & expressions must be surrounded by parentheses as shown below.
Figure 1 – Filtering the requested ship dates in an AX query for tomorrow (current day + 1)
On any form with a grid, you filter your data by pressing Ctrl+G.
If I were to want to see open customer invoices from the last 90 days, I
would filter my open customer invoices form and use the method(dayRange(-90,0)).
The first number represents how many months backward from this month,
and the second represents how many months forward. The same sorts of
things can be done for themonthRange(), yearRange(), and dateRange()
methods. The best part about this is that you can of course save these
filters to create views that you might use on a daily basis.
Figure 2 – Searching the grid for the past 90 days
If you are creating your query ranges in
code, these methods can also be utilized whenever you are setting them.
Definitely be sure to check out the SysQueryRangeUtil class as there are
many more methods to use.
Kamis, 26 Mei 2016
AX : Get Company info AX 2012
Contoh :
salesordersheadertmp.CompanyAddress = CompanyInfo::find().postalAddress().Address;
salesordersheadertmp.CompanyPhone = CompanyInfo::find().phone();
salesordersheadertmp.CompanyName =CompanyInfo::find().Name();
salesordersheadertmp.CompanyTeleFax = CompanyInfo::find().teleFax();
salesordersheadertmp.CompanyGiro = CompanyInfo.Giro;
salesordersheadertmp.CompanyCoRegNum = CompanyInfo.CoRegNum;
salesordersheadertmp.CompanyEnterpriseNumber = CompanyInfo.EnterpriseNumber;
salesordersheadertmp.CompanyAddress = CompanyInfo::find().postalAddress().Address;
salesordersheadertmp.CompanyPhone = CompanyInfo::find().phone();
salesordersheadertmp.CompanyName =CompanyInfo::find().Name();
salesordersheadertmp.CompanyTeleFax = CompanyInfo::find().teleFax();
salesordersheadertmp.CompanyGiro = CompanyInfo.Giro;
salesordersheadertmp.CompanyCoRegNum = CompanyInfo.CoRegNum;
salesordersheadertmp.CompanyEnterpriseNumber = CompanyInfo.EnterpriseNumber;
Minggu, 22 Mei 2016
AX : Query Value +30 atau -30 di AX 2012
bisa dicoba ini
DateTimeUtil::addMonths(DateTimeUtil::utcNow(), -1))
-1 maksudnya 1 bulan
atau ini
>= Now() + 30
atau coba ini juga
>= today() + 30
DateTimeUtil::addMonths(DateTimeUtil::utcNow(), -1))
-1 maksudnya 1 bulan
atau ini
>= Now() + 30
atau coba ini juga
>= today() + 30
Rabu, 18 Mei 2016
AX : Method untuk > atau < apabila kondisi date
Method untuk tanggal kurang dari hari ini
(lessThanUtcNow())
Method untuk tanggal lebih dari hari ini
validTo (greaterThanUtcNow())
(lessThanUtcNow())
Method untuk tanggal lebih dari hari ini
validTo (greaterThanUtcNow())
Wifi Lenovo G40-70 Tidak Nyala ( not detected ) - http://kbhb86.blogspot.co.id
Sering kali
terjadi hal seperti ini wifi tidak nyala / not conected, padahal semua
driver sudah terinstal. Lihat cara instal driver wifi dan cara
mengaktifkannya di bawah ini :
1. Instal
terlebih dahulu driver energy manager, ikuti langkah - langkahnya hingga
selesai sampai muncul perintah selesai dan restart.
Gambar 1.1 |
Gambar 1.2 |
Selasa, 17 Mei 2016
Query : Menghitung Jumlah Karakter
menggunakan length, contoh
SELECT kode_produk, length(kode_produk) AS panjang FROM ms_produk LIMIT 0,10;
Senin, 16 Mei 2016
AX SSRS : IF Condition with enter ( TRUE )
=First(Fields!VendAddress.Value, "InvoiceHeadPOTmpDS")
+IIF(IsNothing(First(Fields!VendPhone.Value, "InvoiceHeadPOTmpDS")) OR First(Fields!VendPhone.Value, "InvoiceHeadPOTmpDS") = ""
,"", VBCRLF+First(Fields!VendPhone.Value, "InvoiceHeadPOTmpDS") )
+IIF(IsNothing(First(Fields!VendFax.Value, "InvoiceHeadPOTmpDS")) OR First(Fields!VendFax.Value, "InvoiceHeadPOTmpDS") = ""
,"",VBCRLF+First(Fields!VendFax.Value, "InvoiceHeadPOTmpDS") )
+IIF(IsNothing(First(Fields!VendPhone.Value, "InvoiceHeadPOTmpDS")) OR First(Fields!VendPhone.Value, "InvoiceHeadPOTmpDS") = ""
,"", VBCRLF+First(Fields!VendPhone.Value, "InvoiceHeadPOTmpDS") )
+IIF(IsNothing(First(Fields!VendFax.Value, "InvoiceHeadPOTmpDS")) OR First(Fields!VendFax.Value, "InvoiceHeadPOTmpDS") = ""
,"",VBCRLF+First(Fields!VendFax.Value, "InvoiceHeadPOTmpDS") )
Minggu, 15 Mei 2016
AX SSRS : Menggabungkan Field dan Menambahkan Enter di SSRS Report
contoh :
= First(Fields!Name.Value, "DataSet1") & VBCRLF &
First(Fields!Address1.Value, "DataSet1") & VBCRLF &
IIF(First(Fields!Address2.Value, "DataSet1") Is Nothing, "", First(Fields!Address2.Value, "DataSet1") & VBCRLF) &
IIF(First(Fields!Address3.Value, "DataSet1") Is Nothing, "", First(Fields!Address3.Value, "DataSet1") & VBCRLF) &
First(Fields!ZipCode.Value, "DataSet1")
Fungsi & adalah untuk menggabungkan field
VBCRLF fungsinya sebagai petunjuk enter
Jumat, 13 Mei 2016
Query : Query Update With Concat Substr
Contoh :
update karyawan set joindate=CONCAT(SUBSTR(SSN,1,4),"-",SUBSTR(SSN,5,2),"-", SUBSTR(SSN,7,2))
update karyawan set joindate=CONCAT(SUBSTR(SSN,1,4),"-",SUBSTR(SSN,5,2),"-", SUBSTR(SSN,7,2))
Query : Contoh Query Concat With Substr
Contoh :
SELEcT name,ssn, CONCAT(SUBSTR(SSN,1,4),"-",SUBSTR(SSN,5,2),"-", SUBSTR(SSN,7,2)) from karyawan
SELEcT name,ssn, CONCAT(SUBSTR(SSN,1,4),"-",SUBSTR(SSN,5,2),"-", SUBSTR(SSN,7,2)) from karyawan
Rabu, 11 Mei 2016
Excel : If di Excel (http://rumuslengkap.com)
Rumus IF merupakan salah satu fungsi paling umum yang digunakan dalam Microsoft Excel.
Fungsi IF atau yang juga bisa diartikan “jika”, digunakan untuk
mengecek suatu kondisi. Apabila kondisi terpenuhi maka fungsi akan
mengambil suatu nilai, dan sebaliknya apabila kondisi tersebut tidak
terpenuhi maka akan diambil nilai yang lain. dengan kata lain, fungsi IF
disebut fungsi syarat. Jika suatu nilai mempunyai syarat dan dapat
bernilai benar apabila syarat terpenuhi serta bernilai salah jika syarat
tidak terpenuhi.
Excel : Formula If dengan Warna (copas http://kangmansyur.blogspot.co.id)
Bagaimana
membuat sebuah grade atas nilai suatu mahasiswa tertentu, dan bagaimana
memberikan pewarnaan di exel atas berbagai grade nilai mahasiswa
tersebut. Untuk contohnya mari kita coba di excel sebagai berikut
Kamis, 05 Mei 2016
AX ; Query Join AX
qbdsCIT = query.addDataSource(tableNum(CustInvoiceTrans));
qbdsAgreementLineReleasedLine = qbdsCIT.addDataSource(tableNum(AgreementLineReleasedLineUnion));
qbdsAgreementLineReleasedLine.joinMode(JoinMode::ExistsJoin);
qbdsAgreementLineReleasedLine.addLink(fieldNum(CustInvoiceTrans, RecId),
fieldNum(AgreementLineReleasedLineUnion,CustInvoiceTrans));
qbdsAgreementLine = qbdsAgreementLineReleasedLine.addDataSource(tableNum(AgreementLine));
qbdsAgreementLine.joinMode(JoinMode::ExistsJoin);
qbdsAgreementLine.addLink(fieldNum(AgreementLineReleasedLineUnion, AgreementLine),
fieldNum(AgreementLine, RecId));
qbdsAgreementHeader = qbdsAgreementLine.addDataSource(tablenum (SalesAgreementHeader));
qbdsAgreementHeader.joinMode(JoinMode::ExistsJoin);
qbdsAgreementHeader.addLink(fieldNum(AgreementLine, Agreement),
fieldNum(SalesAgreementHeader, RecId));
qbdsAgreementHeader.addRange(fieldNum(SalesAgreementHeader, Salesnumbersequence)).value(nomorsacari);
qr = new QueryRun(query);
while (qr.next())
{
CT = qr.Get(tableNum(CustInvoiceTrans));
//ID = qr.Get(tableNum(InventDim));
InvoiceAndFreeTaxTmp.clear();
InvoiceAndFreeTaxTmp.InvoiceId = CT.InvoiceId;
InvoiceAndFreeTaxTmp.tanggal = CT.InvoiceDate;
InvoiceAndFreeTaxTmp.nmrSO = CT.OrigSalesId;
InvoiceAndFreeTaxTmp.licenseplate=CT.LicensePlate();
InvoiceAndFreeTaxTmp.ka=CT.KadarAir();
InvoiceAndFreeTaxTmp.CIT_SDL=CT.SourceDocumentLine;
//InvoiceAndFreeTaxTemp.licenseplate=CustInvoicePackingSlip::PackAndLicense(0, CT.RecId);
InvoiceAndFreeTaxTmp.KG=CT.Qty;
//InvoiceAndFreeTaxTmp.ka=CustInvoicePackingSlip::KadarAirs(0, CT.RecId);
InvoiceAndFreeTaxTmp.refraksipercent=CT.markupAmountPercent();
InvoiceAndFreeTaxTmp.refraksipcs=CT.markupAmountPcs();
InvoiceAndFreeTaxTmp.jumlah=CT.LineInvoiceAmount();
InvoiceAndFreeTaxTmp.harga=CT.PriceUnit;
cittvalue=CT.SourceDocumentLine;
//info(int642str(cittvalue));
InvoiceAndFreeTaxTmp.komoditi=CT.Name;
if(CT.B2BSupplier()!="")
{
InvoiceAndFreeTaxTmp.supplier=CT.B2BSupplier();
}
else
{
InvoiceAndFreeTaxTmp.supplier=CT.inventLocationId();
}
if(CT.OrigSalesId=="")
{
InvoiceAndFreeTaxTmp.FreeTax=1;
InvoiceAndFreeTaxTmp.Jenis='FREETEXT';
}
InvoiceAndFreeTaxTmp.insert();
////////////////////////////////////////////////////////////////
///
}
qbdsAgreementLineReleasedLine = qbdsCIT.addDataSource(tableNum(AgreementLineReleasedLineUnion));
qbdsAgreementLineReleasedLine.joinMode(JoinMode::ExistsJoin);
qbdsAgreementLineReleasedLine.addLink(fieldNum(CustInvoiceTrans, RecId),
fieldNum(AgreementLineReleasedLineUnion,CustInvoiceTrans));
qbdsAgreementLine = qbdsAgreementLineReleasedLine.addDataSource(tableNum(AgreementLine));
qbdsAgreementLine.joinMode(JoinMode::ExistsJoin);
qbdsAgreementLine.addLink(fieldNum(AgreementLineReleasedLineUnion, AgreementLine),
fieldNum(AgreementLine, RecId));
qbdsAgreementHeader = qbdsAgreementLine.addDataSource(tablenum (SalesAgreementHeader));
qbdsAgreementHeader.joinMode(JoinMode::ExistsJoin);
qbdsAgreementHeader.addLink(fieldNum(AgreementLine, Agreement),
fieldNum(SalesAgreementHeader, RecId));
qbdsAgreementHeader.addRange(fieldNum(SalesAgreementHeader, Salesnumbersequence)).value(nomorsacari);
qr = new QueryRun(query);
while (qr.next())
{
CT = qr.Get(tableNum(CustInvoiceTrans));
//ID = qr.Get(tableNum(InventDim));
InvoiceAndFreeTaxTmp.clear();
InvoiceAndFreeTaxTmp.InvoiceId = CT.InvoiceId;
InvoiceAndFreeTaxTmp.tanggal = CT.InvoiceDate;
InvoiceAndFreeTaxTmp.nmrSO = CT.OrigSalesId;
InvoiceAndFreeTaxTmp.licenseplate=CT.LicensePlate();
InvoiceAndFreeTaxTmp.ka=CT.KadarAir();
InvoiceAndFreeTaxTmp.CIT_SDL=CT.SourceDocumentLine;
//InvoiceAndFreeTaxTemp.licenseplate=CustInvoicePackingSlip::PackAndLicense(0, CT.RecId);
InvoiceAndFreeTaxTmp.KG=CT.Qty;
//InvoiceAndFreeTaxTmp.ka=CustInvoicePackingSlip::KadarAirs(0, CT.RecId);
InvoiceAndFreeTaxTmp.refraksipercent=CT.markupAmountPercent();
InvoiceAndFreeTaxTmp.refraksipcs=CT.markupAmountPcs();
InvoiceAndFreeTaxTmp.jumlah=CT.LineInvoiceAmount();
InvoiceAndFreeTaxTmp.harga=CT.PriceUnit;
cittvalue=CT.SourceDocumentLine;
//info(int642str(cittvalue));
InvoiceAndFreeTaxTmp.komoditi=CT.Name;
if(CT.B2BSupplier()!="")
{
InvoiceAndFreeTaxTmp.supplier=CT.B2BSupplier();
}
else
{
InvoiceAndFreeTaxTmp.supplier=CT.inventLocationId();
}
if(CT.OrigSalesId=="")
{
InvoiceAndFreeTaxTmp.FreeTax=1;
InvoiceAndFreeTaxTmp.Jenis='FREETEXT';
}
InvoiceAndFreeTaxTmp.insert();
////////////////////////////////////////////////////////////////
///
}
Langganan:
Postingan (Atom)