Dynamics Ax Dialog
Dialog ekranı üzerindeki alanların(DialogField) nasıl ezilebilebileceğini bir örnekle inceleyelim.
İstenilen alanın DataSource'u View ise;
View'in DataSource'undan ilgili Table'ın RecId'sini Fields'lerin içine atıyoruz.
RecId1 olarak gelir ben adını TransRecId olarak değiştirdim.
Sonra Dialog ekleyeceğim forma geliyoruz, bir buton ekleyip clicked metoduna;
void clicked()
{
super();
element.updateBankNegInstRecipient();
}
updateBankNegInstRecipient metodunu da Formun Methods kısmına yazıyoruz.
void updateBankNegInstRecipient()
{
Dialog d = new Dialog("Faiz Oranı & Vade Tarihi düzenle");
DialogField dlgBankNegInstRecipientName;
DialogField dlgDueDate;
DialogGroup dlgGroup;
LedgerJournalTrans ledgerJournalTrans;
;
dlgGroup = d.addGroup("Düzenle");
dlgGroup.widthMode(FormWidth::ColumnWidth);
dlgBankNegInstRecipientName = d.addField(typeid(BankNegInstRecipientName), "Faiz Oranı");
dlgBankNegInstRecipientName.value(DRTLedgerJournalTrans.BankNegInstRecipientName);
dlgDueDate = d.addField(typeid(DueDate), "Vade Tarihi");
dlgDueDate.value(DRTLedgerJournalTrans.Due);
d.run();
{
if (d.closedOk())
{
{
ttsbegin;
ledgerJournalTrans=ledgerJournalTrans::findRecId(DRTLedgerJournalTrans.TransRecId, true);
if ( ledgerJournalTrans )
{
ledgerJournalTrans.BankNegInstRecipientName = dlgBankNegInstRecipientName.value();
ledgerJournalTrans.Due = dlgDueDate.value();
ledgerJournalTrans.doUpdate();
}
ttscommit;
DRTLedgerJournalTrans_ds.research(true);
}
}
}
}
Hiç yorum yok:
Yorum Gönder