All Archives in this blog may be used for the Junior,Dummies or someone who just started for career at Dynamics Ax ... A Place Where U can Start ur Code - right here ...
Senin, 06 Juni 2022
Menambahkan inventory dimension
https://sivakumar007.wordpress.com/2007/12/28/inventory-dimension-setup-button-in-form/
Selasa, 29 Maret 2022
Class Product Receipt di AX2012
Jadi ditempat kerjaku sekarang ada requirement untuk menyimpan nomor kendaraan supplier yang mengantarkan barang.
Di standard AX tidak ada kolom no Polisi. jadi harus saya custom di PurchParmTable.
pertanyaanya class apa yang mengeksekusi Product receipt dan menciptakan record di VendPackingSlipJour.
Class yang mengekseskusinya ada di PurchPackingSlipJournalCreate.
Method yang saya pakai adalah PurchPackingSlipJournalCreate.initheader().
Class ini extends ke sebuah class abastract. Jadi jika ingin mendebug class ini kita harus menguncek CILL di User Option.
selamat mencoba
Jumat, 11 Februari 2022
Create notification x++
untuk menghardcode notification/lonceng di AX bisa memakai table-table berikut.
EventInbox & SysUserInfo
Contoh penggunaan :
EventInbox EventInbox,inbox;
SysUserInfo SysUserInfo;
select SysUserInfo order by SysUserInfo.Id
where SysUserInfo.Id == "Husna";//ax account Husna
ttsbegin();
select maxof(inboxId) from inbox;
EventInbox.InboxId = EventInbox::nextEventId();
EventInbox.CompanyId = "psm";
EventInbox.AlertTableId = 105939;//2271;//diisi dengan tableId yang menjadi referensi table.
EventInbox.AlertCreatedDateTime = DateTimeUtil::utcNow();
EventInbox.ParentTableId = 105939;//2271;//diisi dengan tableId yang menjadi referensi table.
EventInbox.IsRead = NOYES::No;
EventInbox.Subject = "Update minimum stock information "+usernotif.ItemId;
EventInbox.AlertedFor = "update minimum stock information "+usernotif.ItemId;
EventInbox.UserId = SysUserInfo.Id;
EventInbox.ShowPopup = NOYES::Yes;
EventInbox.Visible = NOYES::Yes;
EventInbox.Message = strfmt("Minimum stok item "+usernotif.ItemId+" sudah lebih kecil atau sama dengan rata-rata pemakaian");
EventInbox.insert();
ttscommit();
Mencari userId dari HcmWorker.RecId
Untuk mencari User Id dari HcmWoker bisa menggunakan DirPersonUser::findParty()
contoh penggunaan :
HcmWorker worker;
;
select worker
where worker.recId == 12345678;
info(DirPersonUser::findParty(worker.person).user);
Kamis, 10 Februari 2022
Highlight record with background color
Over write method displayOption di Datasource.
Contoh :
public void displayOption(Common _record, FormRowDisplayOption _options)
{
PSMLeadTimeItem psmleadtimelocal;
//super(_record, _options);
psmleadtimelocal = _record as PSMLeadTimeItem;
if(psmleadtimelocal.min == 0)
_options.backColor(WinApi::RGB2int(255,255,0));//jadi kuning
else
_options.backColor(WinAPI::RGB2int(255,255,255));
}
Kamis, 27 Januari 2022
Error go to Origin
Tambahkan code berikut di Init form
if(this.args().menuItemName() != 'RS_HRIDN_BookingTransportPerm')
{
RS_HRIDN_BookingTransportPerm_ds.query().dataSourceTable(tableNum(RS_HRIDN_BookingTransportPerm))
.addRange(fieldNum(RS_HRIDN_BookingTransportPerm, IsGatePermission)).value(SysQuery::value(NoYes::Yes));
}
Kamis, 13 Januari 2022
Create Sequence number di AX2012
Contoh kasus :
Kita akan membuat form baru di modul Procurement and sourching. Kita bilang form ini form Berita Acara.
form ini mempunyai datasource BeritaAcaratable. dengan fields :
- BeritaacaraId
- Transdate
- Description
- Buat Extended data type BeritaacaraId.
- Di Class NumberSeqModulePurchaseOrder/Loadmodule, tambahkan code berikut.
//start husna
datatype.parmDatatypeId(extendedTypeNum(BeritaacaraId));
datatype.parmReferenceHelp(literalStr("Berita acara"));
datatype.parmWizardIsContinuous(true);
datatype.parmWizardIsManual(NoYes::No);
datatype.parmWizardIsChangeDownAllowed(NoYes::No);
datatype.parmWizardIsChangeUpAllowed(NoYes::No);
datatype.parmSortField(999999);
datatype.addParameterType(NumberSeqParameterType::DataArea, true, false);
this.create(datatype);
//end husna
3. Di table PurchParameter/Methods/ tambahkan methods berikut :
//add Husna 20220113
static client server NumberSequenceReference numRefBeritaAcara()
{
return NumberSeqReference::findReference(extendedTypeNum(BeritaacaraId));
}
4. Buat job untuk memanggil module tambahan dan Extended data yang dibuat tadi. Job seperti berikut :
static void loadNumSeqPurchDemo(Args _args)
{
//define the class variable
NumberSeqModulePurchaseOrder seqMod = new NumberSeqModulePurchaseOrder();
//load the number sequences that were not generated
seqMod.load();
}
5. Buke menu Organization administration/Common/Number sequences/Number sequences. Klik tombol Generate. Pilih/cari reference modul "Berita acara" dan Company yang akan dipakai. Disana akan terbaca Sequence number ID yang related pada Berita Acara. klik OK
6. Buka modul Procurement and Sourching/Setup/Procurement parameter. Buka Tab Sequence number. disana akan ada reference baru, Berita Acara dengan Sequence Id nya.
7. Buat Form Berita Acara. lengkap dengan table/datasourcenya (BeritaAcaraTable).
8. Di Form BeritaAcara/Methods/, overide method close() dan numberSeqFormHandler()
public void close()
{
if (numberSeqFormHandler)
{
numberSeqFormHandler.formMethodClose();
}
super();
}
NumberSeqFormHandler numberSeqFormHandler()
{
if (!numberSeqFormHandler)
{
//create a reference of number sequence form handler class specifying the EDT, Data source name and the field of the table
numberSeqFormHandler = NumberSeqFormHandler::newForm(NumberSeqReference::findReference(extendedtypenum(PSMGRNRevisionId)).NumberSequenceId, element,PSMGRNRevisiontable_DS,fieldnum(PSMGRNRevisiontable,PSMGRNRevisionId));
}
return numberSeqFormHandler;
}
9. Di Datasource overwrite methods :
public void create(boolean _append = false)
{
element.numberSeqFormHandler().formMethodDataSourceCreatePre();
super(_append);
element.numberSeqFormHandler().formMethodDataSourceCreate(true);
}
public void write()
{
super();
element.numberSeqFormHandler().formMethodDataSourceWrite();
}
public boolean validateWrite()
{
boolean ret;
ret = super();
ret = element.numberSeqFormHandler().formMethodDataSourceValidateWrite(ret) && ret;
return ret;
}
public void linkActive()
{
element.numberSeqFormHandler().formMethodDataSourceLinkActive();
super();
}
//untuk method deleted() dipakai jika ada table lines/detail
public void deleted()
{
//element.numberSeqFormHandler().formMethodDataSourceDelete();
super();
}
Langganan:
Postingan (Atom)
Cloud hosted environment di D365
Biasanya kita menginginkan sebuah environment yang sama dengan LIVE/PROD untuk mengtest sebuah proses. Maka kita bisa menggunakan fitur Clou...
-
Biasanya kita menginginkan sebuah environment yang sama dengan LIVE/PROD untuk mengtest sebuah proses. Maka kita bisa menggunakan fitur Clou...
-
Kali ini saya mendapatkan erorr dengan code CS1963, padahal sebelumnya saya sudah mendefinisikan 'var item in Model' di @foreach(var...
-
Microsoft memunculkan update untuk 365 4x dalam setahun. Biasanya disebut service update. Sebelum anda mengaplikasikan service update ini le...