...
Filename Filename;
System.IO.StreamReader readFile;
System.String line;
int hwnd;
;
hwnd = infolog.hwnd();
Filename = WinApi::getOpenFileName(hwnd,['TXT files','*.txt'],"","Text Files");
// Filename = WinApi::getOpenFileName(element.hWnd(),['TXT files','*.txt'],"","Text Files");
if (!Filename)
return;
readFile = new System.IO.StreamReader(filename,System.Text.Encoding::get_UTF8());
while (true)
{
line = readFile.ReadLine();
if(System.String::IsNullOrEmpty(line))
break;
warning(line);
}
readFile.Close();
readFile.Dispose();
...
There are other ways, one of them is at Fatih Demirci's blog.
25 Mart 2013 Pazartesi
8 Şubat 2013 Cuma
AXAPTA - Get default printer name
printJobSettings p = new PrintJobSettings();
;
info(p.printerPrinterName());
;
info(p.printerPrinterName());
6 Şubat 2013 Çarşamba
AXAPTA - what's difference with DoInsert() and Insert()
"Calling DoInsert ensures that any Axapta X++ code written in insert method of the record is not executed"
http://dynamicsuser.net/forums/t/53377.aspx
http://dynamicsuser.net/forums/t/53377.aspx
4 Şubat 2013 Pazartesi
AXAPTA - Catch tabbed dialog enter and exit
Use pageActivated() for catch enter tabbed dialog, use allowPageDeactivate() for catch exit. I tried to use Lostfocus() and GotFocus() with no success.
31 Ocak 2013 Perşembe
AXAPTA - Send alert to a user
static void sendAlertToUser(UserId _UserId,EventSubject _Subject,EventMessage _Message)
{
EventInbox inbox;
EventInboxId inboxId;
SysClientSessions sessions;
;
inboxId = EventInbox::nextEventId();
inbox.initValue();
inbox.ShowPopup = NoYes::Yes;
inbox.Subject = _Subject;
inbox.Message = _Message;
inbox.SendEmail = true;
inbox.UserId = _UserId;
inbox.InboxId = inboxId;
inbox.AlertCreatedDateTime = DateTimeUtil::getSystemDateTime();
inbox.insert();
}
{
EventInbox inbox;
EventInboxId inboxId;
SysClientSessions sessions;
;
inboxId = EventInbox::nextEventId();
inbox.initValue();
inbox.ShowPopup = NoYes::Yes;
inbox.Subject = _Subject;
inbox.Message = _Message;
inbox.SendEmail = true;
inbox.UserId = _UserId;
inbox.InboxId = inboxId;
inbox.AlertCreatedDateTime = DateTimeUtil::getSystemDateTime();
inbox.insert();
}
AXAPTA - Create Sales Order with X++
...
SalesTable salesTable;
NumberSeq NumberSeq;
SalesLine salesLine;
AxSalesLine axSalesLine = new axSalesLine();
AxSalesTable axsalesTable = new axSalesTable();
;
...
ttsbegin;
axsalesTable.parmSalesId();
if (ServiceOrder.CustName == "")
axsalesTable.parmCustAccount(ServiceOrder.CustAccount);// Cust Account
else
axsalestable.parmOneTimeCustomer(Dialog_OneTime.value());
axsalesTable.parmDlvMode(Dialog_DLVMode.value());
axsalesTable.parmDlvTerm(Dialog_DLVTerm.value());
axsalesTable.save();
while select forupdate Lines where Lines.RepairJournalId == _RepairJournalId && Lines.SalesId == "" &&
Lines.CSApproval == B_Approval::Approved && Lines.ItemId != "" && Lines.Qty > 0
{
axSalesLine = AxSalesLine::construct();
axSalesLine.parmSalesId(axsalesTable.parmSalesId());
axSalesLine.parmItemId(Lines.ItemId);
axSalesLine.parmSalesQty(Lines.Qty);
axSalesline.parmSalesPrice(Lines.ProjSalesPrice);
axSalesline.parmCurrencyCode(Lines.ProjCurrencyCode);
axSalesline.parmSalesUnit(Lines.Unit);
Lines.SalesId = axsalesTable.parmSalesId();
Lines.update();
axSalesLine.save();
}
ttscommit;
...
SalesTable salesTable;
NumberSeq NumberSeq;
SalesLine salesLine;
AxSalesLine axSalesLine = new axSalesLine();
AxSalesTable axsalesTable = new axSalesTable();
;
...
ttsbegin;
axsalesTable.parmSalesId();
if (ServiceOrder.CustName == "")
axsalesTable.parmCustAccount(ServiceOrder.CustAccount);// Cust Account
else
axsalestable.parmOneTimeCustomer(Dialog_OneTime.value());
axsalesTable.parmDlvMode(Dialog_DLVMode.value());
axsalesTable.parmDlvTerm(Dialog_DLVTerm.value());
axsalesTable.save();
while select forupdate Lines where Lines.RepairJournalId == _RepairJournalId && Lines.SalesId == "" &&
Lines.CSApproval == B_Approval::Approved && Lines.ItemId != "" && Lines.Qty > 0
{
axSalesLine = AxSalesLine::construct();
axSalesLine.parmSalesId(axsalesTable.parmSalesId());
axSalesLine.parmItemId(Lines.ItemId);
axSalesLine.parmSalesQty(Lines.Qty);
axSalesline.parmSalesPrice(Lines.ProjSalesPrice);
axSalesline.parmCurrencyCode(Lines.ProjCurrencyCode);
axSalesline.parmSalesUnit(Lines.Unit);
Lines.SalesId = axsalesTable.parmSalesId();
Lines.update();
axSalesLine.save();
}
ttscommit;
...
29 Kasım 2012 Perşembe
AXAPTA Add Range with SysQuery to Form & Report
For Form:
SysQuery::findOrCreateRange(B_RMAOutTable_DS.query().dataSourceTable(tablenum(B_RMAOutTable)), fieldnum(B_RMAOutTable,RMAIn)).
value(QueryValue(NoYes::Yes));
For Report:
SysQuery::findOrCreateRange(this.query().dataSourceTable(tablenum(SMAServiceOrderTable)),
fieldnum(SMAServiceOrderTable,ItemSerialNum)).
value(sysquery::valueNotEmptyString());
Run methoduna super'den önce yazabilirsiniz.
You may add this code to before run method's super() call.
SysQuery::findOrCreateRange(B_RMAOutTable_DS.query().dataSourceTable(tablenum(B_RMAOutTable)), fieldnum(B_RMAOutTable,RMAIn)).
value(QueryValue(NoYes::Yes));
For Report:
SysQuery::findOrCreateRange(this.query().dataSourceTable(tablenum(SMAServiceOrderTable)),
fieldnum(SMAServiceOrderTable,ItemSerialNum)).
value(sysquery::valueNotEmptyString());
Run methoduna super'den önce yazabilirsiniz.
You may add this code to before run method's super() call.
Kaydol:
Kayıtlar (Atom)