MS Dynamics Ax kurulumlarında geliştirme veya test ortamları kurulumu yapılıyorsa AOS servisini çalıştırmak için NT AUTHORITY\NETWORK SERVICE hesabının kullanılması tavsiye edilir.
Eğer müşteri kurulumu yapılıyorsa yapılandırma ve güvenlik gerekçeleriyle yeni bir hesap açılıp bu hesap üzerinden kurulum yapılmalıdır.
Bu durumda açılan hesabın SQL'de Ax veritabanı üzerinde db_ddladmin, db_datawriter, db_datareader rollerinin üyesi olması yeterlidir.
Eğer Ax kurulumu yapılan kullanıcı daha sonra değiştirilirse
DB üzerinde SQL-> AXDB -> Security-> Users bölümünde kullanıcı eklenmeli , yukardaki roller atanmalıdır.
Ayrıca SQL -> AXDB -> Security -> Users -> Securable bölümünde CREATESERVERSESSIONS , CREATEUSERSESSIONS prosedürleri eklenmeli Exec yetkisi verilmedir.
Aksi taktirde sistem servisi başlatmayacak
"Object Server 01: Internal Error occurred executing stored procedure when creating session for the AOS. "
hatası verecektir.
31 Aralık 2009 Perşembe
Ax2009 da kullanılan Office Web Components tarih olacak
Microsoft Office 2003 sürümünden sonra OWC11 setini kaldırmış.
http://blogs.msdn.com/excel/archive/2006/07/17/668544.aspx
adresinden açıklama okunabilir.
Bu Axv4 veya Ax2009 da yapılan geliştirmelere son vermek gerektiğini söyler açıkça.
Microsoft Office Pivot Table
Microsoft Office SpreadSheet
Microsoft Office Chart activexleri ile yapılan geliştirmeler için alternatifleri öğrenmeli.
"Yaşasın SharePoint" demeli ;)
Yinede mevcut geliştirmeler için veya elimahkum geliştirmeler için bağımsız olarak kullanılabilir.
http://www.microsoft.com/downloads/details.aspx?familyid=7287252C-402E-4F72-97A5-E0FD290D4B76&displaylang=en
adresinden dosyalar indirilebilir.
http://blogs.msdn.com/excel/archive/2006/07/17/668544.aspx
adresinden açıklama okunabilir.
Bu Axv4 veya Ax2009 da yapılan geliştirmelere son vermek gerektiğini söyler açıkça.
Microsoft Office Pivot Table
Microsoft Office SpreadSheet
Microsoft Office Chart activexleri ile yapılan geliştirmeler için alternatifleri öğrenmeli.
"Yaşasın SharePoint" demeli ;)
Yinede mevcut geliştirmeler için veya elimahkum geliştirmeler için bağımsız olarak kullanılabilir.
http://www.microsoft.com/downloads/details.aspx?familyid=7287252C-402E-4F72-97A5-E0FD290D4B76&displaylang=en
adresinden dosyalar indirilebilir.
23 Eylül 2009 Çarşamba
Axapta Excel import text formatted numeric values
While importing string values from MS Excel we use
SysExcelWorksheet.cells().item(8,j).value().bstr();
But, if cell value is numeric, Excel returns blank value.
So you have to control the value by a function below :
str valuestr(SysExcelCell _cell)
{
if (_cell.value().bStr())
return _cell.value().bStr();
else
{
if (_cell.value().double())
return strltrim(num2str(_cell.value().double(),20,0,0,0));
return "";
}
}
SysExcelWorksheet.cells().item(8,j).value().bstr();
But, if cell value is numeric, Excel returns blank value.
So you have to control the value by a function below :
str valuestr(SysExcelCell _cell)
{
if (_cell.value().bStr())
return _cell.value().bStr();
else
{
if (_cell.value().double())
return strltrim(num2str(_cell.value().double(),20,0,0,0));
return "";
}
}
30 Temmuz 2008 Çarşamba
Expand number of columns dynamically in report - Fetch example
// You should create tmp tables named TmpTotalTable and TmpTotalHeader and extended data type that has maximum number of elements. Then create a field in tmp tables type of extended data type.
public boolean fetch()
{
TmpTotalTable tmpsum,totalsum,totalsumym;
CustInvoiceJour custinvoicejour, custinvoicejourgr;
custGroup custgroup;
custTable custTable;
iNt i,j,offsetym,lastcol;
ReportStringControl headerfield;
ReportTextControl space;
ReportRealControl sumfield;
ReportRealControl percentfield;
Amount totalamountcur , totalamountYTL, totalamountEUR;
;
if (element.prompt())
{
sums.setTmpdata(tmpsum);
headers.clear();
while select currencycode from custinvoicejour
group by currencycode
where custinvoicejour.InvoiceDate >= datefrom
&& custinvoicejour.InvoiceDate <= dateto
{
i++;
headers.TotalName[i] = custinvoicejour.CurrencyCode;
headerfield = headersection.addStringControl(tablenum(TmpTotalHeader),fieldid2ext(fieldnum(TmpTotalHeader,TotalName),i));
headerfield.alignment(Alignment::Right);
headerfield.width(16,units::Char);
sumfield = sumsection.addRealControl(tablenum(TmpTotalTable),fieldid2ext(fieldnum(TmpTotalTable,Total),i));
sumfield.width(16,units::Char);
sumfield.sumAll(true);
}
colcount = i;
offsetym = i+1;
headers.insert();
this.send(headers);
headersection.executeSection();
while select custgroup from custinvoicejourgr
group by custgroup
where custinvoicejourgr.InvoiceDate >= datefrom
&& custinvoicejourgr.InvoiceDate <= dateto
{
sums.clear();
totalamountcur = 0;
totalamountytl = 0;
totalamounteur = 0;
sums.MaddeGrubu = custinvoicejourgr.CustGroup;
for (i=1; i<=colcount ; i++)
{
totalamountcur = 0;
select
sum(InvoiceAmount) , sum(InvoiceAmountMST), sum(SumTax), sum(SumTaxMST)
from custinvoicejour
where
custinvoicejour.CustGroup == custinvoicejourgr.CustGroup
&& custinvoicejour.CurrencyCode == headers.TotalName[i]
&& custinvoicejour.InvoiceDate >=datefrom
&& custinvoicejour.InvoiceDate <=dateto ;
{
totalamountcur += custinvoicejour.InvoiceAmount - custinvoicejour.SumTax;
total[i] +=totalamountcur;
}
sums.Total[i] = totalamountcur;
}
sums.insert();
}
sums.clear();
sums.totalname ="TOPLAM";
for (i=1; i<=colcount ; i++)
{
sums.Total[i] = total[i];
}
sums.insert();
while select sums
{
this.send(sums);
sumsection.executeSection();
}
}
return true;
}
public boolean fetch()
{
TmpTotalTable tmpsum,totalsum,totalsumym;
CustInvoiceJour custinvoicejour, custinvoicejourgr;
custGroup custgroup;
custTable custTable;
iNt i,j,offsetym,lastcol;
ReportStringControl headerfield;
ReportTextControl space;
ReportRealControl sumfield;
ReportRealControl percentfield;
Amount totalamountcur , totalamountYTL, totalamountEUR;
;
if (element.prompt())
{
sums.setTmpdata(tmpsum);
headers.clear();
while select currencycode from custinvoicejour
group by currencycode
where custinvoicejour.InvoiceDate >= datefrom
&& custinvoicejour.InvoiceDate <= dateto
{
i++;
headers.TotalName[i] = custinvoicejour.CurrencyCode;
headerfield = headersection.addStringControl(tablenum(TmpTotalHeader),fieldid2ext(fieldnum(TmpTotalHeader,TotalName),i));
headerfield.alignment(Alignment::Right);
headerfield.width(16,units::Char);
sumfield = sumsection.addRealControl(tablenum(TmpTotalTable),fieldid2ext(fieldnum(TmpTotalTable,Total),i));
sumfield.width(16,units::Char);
sumfield.sumAll(true);
}
colcount = i;
offsetym = i+1;
headers.insert();
this.send(headers);
headersection.executeSection();
while select custgroup from custinvoicejourgr
group by custgroup
where custinvoicejourgr.InvoiceDate >= datefrom
&& custinvoicejourgr.InvoiceDate <= dateto
{
sums.clear();
totalamountcur = 0;
totalamountytl = 0;
totalamounteur = 0;
sums.MaddeGrubu = custinvoicejourgr.CustGroup;
for (i=1; i<=colcount ; i++)
{
totalamountcur = 0;
select
sum(InvoiceAmount) , sum(InvoiceAmountMST), sum(SumTax), sum(SumTaxMST)
from custinvoicejour
where
custinvoicejour.CustGroup == custinvoicejourgr.CustGroup
&& custinvoicejour.CurrencyCode == headers.TotalName[i]
&& custinvoicejour.InvoiceDate >=datefrom
&& custinvoicejour.InvoiceDate <=dateto ;
{
totalamountcur += custinvoicejour.InvoiceAmount - custinvoicejour.SumTax;
total[i] +=totalamountcur;
}
sums.Total[i] = totalamountcur;
}
sums.insert();
}
sums.clear();
sums.totalname ="TOPLAM";
for (i=1; i<=colcount ; i++)
{
sums.Total[i] = total[i];
}
sums.insert();
while select sums
{
this.send(sums);
sumsection.executeSection();
}
}
return true;
}
Excel Export
static void exportVendorToExcelTEST1(Args _args)
{
SysExcelApplication SysExcelApplication;
SysExcelWorksheet SysExcelWorksheet;
SysExcelWorksheets SysExcelWorksheets;
SysExcelWorkbooks SysExcelWorkbooks;
SysExcelWorkbook SysExcelWorkbook;
SysExcelRange SysExcelRange;
SysExcelCell SysExcelCell;
SysExcelCells SysExcelCells;
COMVariant COMVariant1;
Kriterler kriterler;
VendTable vtab;
Dialog dialog = new Dialog();
DialogField dflItem = dialog.addField(typeid(VendAccount));
#excel
;
while select vtab
where vtab.AccountNum like "S0000*"
{
try
{
sysExcelApplication = SysExcelApplication::construct();
sysExcelApplicatioN.displayAlerts(FALSE);
sysExcelApplication.visible(FALSE);
sysExcelWorkbooks = sysExcelApplication.workbooks();
// for filename
sysExcelApplication.workbooks().open("C:\\"+vtab.AccountNum+".XLS");
sysExcelWorkbook = sysExcelApplication.workbooks().item(1);
SysExcelWorksheets = sysExcelWorkbook.worksheets();
SysExcelWorksheet = SysExcelWorksheets.itemFromNum(1);
SysExcelRange = SysExcelWorksheet.cells().range(#ExcelTotalRange);
SysExcelCell = SysExcelWorksheet.cells().item(1,1);
SysExcelCell.value(systemdateget());
SysExcelCell = SysExcelWorksheet.cells().item(2,2);
SysExcelCell.value(vtab.AccountNum);
sysExcelApplication.save();
sysExcelApplication.quit();
}
catch (exception::Error)
{
}
}
}
{
SysExcelApplication SysExcelApplication;
SysExcelWorksheet SysExcelWorksheet;
SysExcelWorksheets SysExcelWorksheets;
SysExcelWorkbooks SysExcelWorkbooks;
SysExcelWorkbook SysExcelWorkbook;
SysExcelRange SysExcelRange;
SysExcelCell SysExcelCell;
SysExcelCells SysExcelCells;
COMVariant COMVariant1;
Kriterler kriterler;
VendTable vtab;
Dialog dialog = new Dialog();
DialogField dflItem = dialog.addField(typeid(VendAccount));
#excel
;
while select vtab
where vtab.AccountNum like "S0000*"
{
try
{
sysExcelApplication = SysExcelApplication::construct();
sysExcelApplicatioN.displayAlerts(FALSE);
sysExcelApplication.visible(FALSE);
sysExcelWorkbooks = sysExcelApplication.workbooks();
// for filename
sysExcelApplication.workbooks().open("C:\\"+vtab.AccountNum+".XLS");
sysExcelWorkbook = sysExcelApplication.workbooks().item(1);
SysExcelWorksheets = sysExcelWorkbook.worksheets();
SysExcelWorksheet = SysExcelWorksheets.itemFromNum(1);
SysExcelRange = SysExcelWorksheet.cells().range(#ExcelTotalRange);
SysExcelCell = SysExcelWorksheet.cells().item(1,1);
SysExcelCell.value(systemdateget());
SysExcelCell = SysExcelWorksheet.cells().item(2,2);
SysExcelCell.value(vtab.AccountNum);
sysExcelApplication.save();
sysExcelApplication.quit();
}
catch (exception::Error)
{
}
}
}
Explode BOM
//The function below explodes BOM to the lowest level.
//You should create PlanBOM table before executing this function or change the code according to your target.
void explodeBOM()
{
ETGProdPlanBOMTable PlanBOM;
void qtyexplode(ETGProdPlanId _planid, ItemId _ItemId,Qty _qtySerie,int _level)
{
BOM BOMd;
InventTable itabled;
BOMVersion BOMVersiond;
;
select firstonly BOMVersiond
where BOMVersiond.ItemId == _itemid
&& BOMVersiond.Active
&& BOMVersiond.FromDate <= systemdateget()
&& (!BOMVersiond.ToDate || BOMVersiond.ToDate >= systemdateget());
if (BOMVersiond.RecId)
{
While select BOMd
where BOMd.BOMId == BOMVersiond.BOMId
join itabled
where BOMd.ItemId == itabled.ItemId
{
if (itabled.ItemType == ItemType::Item)
{
PlanBOM.clear();
PlanBOM.ItemId = BOMd.ItemId;
PlanBOM.RefItemId = BOMVersiond.ItemId;
PlanBOM.Qty = BOMd.BOMQty / BOMd.BOMQtySerie * _qtyserie;
PlanBOM.PlanId = _planid;
PlanBOM.Level = _level;
PlanBOM.insert();
}
else if (itabled.ItemType == ItemType::BOM)
{
qtyexplode(_planid, BOMd.ItemId, BOMd.BOMQty/BOMd.BOMQtySerie * _qtySerie, _level+1);
}
}
}
}
;
delete_from PlanBOM
where PlanBOM.PlanId == this.ProdPlanrec().PlanId;
qtyexplode(this.ProdPlanrec().PlanId, this.ProdPlanrec().ItemId,this.ProdPlanrec().Qty,1);
}
//You should create PlanBOM table before executing this function or change the code according to your target.
void explodeBOM()
{
ETGProdPlanBOMTable PlanBOM;
void qtyexplode(ETGProdPlanId _planid, ItemId _ItemId,Qty _qtySerie,int _level)
{
BOM BOMd;
InventTable itabled;
BOMVersion BOMVersiond;
;
select firstonly BOMVersiond
where BOMVersiond.ItemId == _itemid
&& BOMVersiond.Active
&& BOMVersiond.FromDate <= systemdateget()
&& (!BOMVersiond.ToDate || BOMVersiond.ToDate >= systemdateget());
if (BOMVersiond.RecId)
{
While select BOMd
where BOMd.BOMId == BOMVersiond.BOMId
join itabled
where BOMd.ItemId == itabled.ItemId
{
if (itabled.ItemType == ItemType::Item)
{
PlanBOM.clear();
PlanBOM.ItemId = BOMd.ItemId;
PlanBOM.RefItemId = BOMVersiond.ItemId;
PlanBOM.Qty = BOMd.BOMQty / BOMd.BOMQtySerie * _qtyserie;
PlanBOM.PlanId = _planid;
PlanBOM.Level = _level;
PlanBOM.insert();
}
else if (itabled.ItemType == ItemType::BOM)
{
qtyexplode(_planid, BOMd.ItemId, BOMd.BOMQty/BOMd.BOMQtySerie * _qtySerie, _level+1);
}
}
}
}
;
delete_from PlanBOM
where PlanBOM.PlanId == this.ProdPlanrec().PlanId;
qtyexplode(this.ProdPlanrec().PlanId, this.ProdPlanrec().ItemId,this.ProdPlanrec().Qty,1);
}
4 Haziran 2008 Çarşamba
Document Management - Opening file from code for a spesific rec.
void showDocument()
{
args args;
docuref docuref;
;
args = new args();
docuRef = docuref::find(salesTable.dataAreaId,tablenum(SalesTable),salesTable.RecId,today());
args.record(docuRef);
args.parmEnumType(enumnum(Docucode));
args.parmEnum(Docucode::Open);
docuaction::main(args);
}
http://dax-lessons.spaces.live.com/Blog/cns!D89D0800DE72FCD1!123.entry
{
args args;
docuref docuref;
;
args = new args();
docuRef = docuref::find(salesTable.dataAreaId,tablenum(SalesTable),salesTable.RecId,today());
args.record(docuRef);
args.parmEnumType(enumnum(Docucode));
args.parmEnum(Docucode::Open);
docuaction::main(args);
}
http://dax-lessons.spaces.live.com/Blog/cns!D89D0800DE72FCD1!123.entry
25 Eylül 2007 Salı
findorcreate
server static InventBatch findOrCreate(InventBatchId _inventBatchId, ItemId _itemId, Real _agirlik = 0)
{
InventBatch inventBatch;
InventBatchId inventBatchId;
;
inventBatch = InventBatch::find(_inventBatchId,_itemId);
if (inventBatch) //inventbatch bulmussan kullaniya onu gonder
return inventBatch;
else
{
if(_inventBatchId) // InventBatchid bos degilse,aksi halde bos kayita izin verir
{
ttsBegin;
inventBatch.inventBatchId = _inventBatchId;
inventBatch.itemId = _itemId;
inventBatch.prodDate = systemdateget();
inventBatch.Agirlik = _agirlik;
inventBatch.insert();
ttsCommit;
return inventBatch;
}
else
return null;
}
}
{
InventBatch inventBatch;
InventBatchId inventBatchId;
;
inventBatch = InventBatch::find(_inventBatchId,_itemId);
if (inventBatch) //inventbatch bulmussan kullaniya onu gonder
return inventBatch;
else
{
if(_inventBatchId) // InventBatchid bos degilse,aksi halde bos kayita izin verir
{
ttsBegin;
inventBatch.inventBatchId = _inventBatchId;
inventBatch.itemId = _itemId;
inventBatch.prodDate = systemdateget();
inventBatch.Agirlik = _agirlik;
inventBatch.insert();
ttsCommit;
return inventBatch;
}
else
return null;
}
}
13 Eylül 2007 Perşembe
Raporda nesne erişimi / Access to object in report
//nesnenin oto tanımlama özelliği aktive edilirse doğrudan ismini kullanarak erişilebilirsiniz.
//you can access to object with its name, if you activate autodecleration property.
//Oto tanımlama yapmadan bir nesnenin özellğini kullanmak için AOT yapısından faydalanılabilir.
//you can access to object Without Aoutodecleration property using AOT
this.design("ReportDesign1").sectionName('ReportHeader').controlName("DispField").delete();
this.design("ReportDesign1").sectionName('ReportHeader').controlName("DispField").hide();
//you can access to object with its name, if you activate autodecleration property.
//Oto tanımlama yapmadan bir nesnenin özellğini kullanmak için AOT yapısından faydalanılabilir.
//you can access to object Without Aoutodecleration property using AOT
this.design("ReportDesign1").sectionName('ReportHeader').controlName("DispField").delete();
this.design("ReportDesign1").sectionName('ReportHeader').controlName("DispField").hide();
11 Eylül 2007 Salı
Bir kayıt için rapor yazdırma / Call a report from a spesific record
//rapor belli bir kayıt için çağırmak istendiğinde yazılacak kod
//code block to call a report from a spesific record
//init içne yazılacak
//embed into init section
// teklif tablosunda bir kayıt için örnek
//example for a quotation record
{
smmQuotationTable callersmmQuotationTable;
QueryBuildDataSource qbds;
;
sysReportRun::getRunbaseReport(this).getLast();
if (element.args().caller())
{
if (! element.args().record().recId)
throw error(strFmt("@SYS22338",funcName()));
switch (element.args().dataset())
{
case tablenum(smmQuotationTable):
callersmmQuotationTable = element.args().record();
break;
default:
throw error(strFmt("@SYS23396",funcName()));
}
}
if (callersmmQuotationTable.QuotationId)
{
qbds = element.query().dataSourceTable(tablenum(smmQuotationTable));
SysQuery::findOrCreateRange(qbds, fieldnum(smmQuotationTable,QuotationId)).value(callersmmQuotationTable.QuotationId);
}
super();
}
Kaydol:
Kayıtlar (Atom)