Assume that your class gets data from various tables.
CustVendVoucher -> initCustVendTrans method
...
fieldid = fieldName2Id(common.TableId,'Payment');
if (fieldid)
{
custVendTrans.Payment = common.(fieldid); // You must create mappings
}
....
13 Ağustos 2010 Cuma
Using fieldid & fieldname to set value
Etiketler:
ax2009,
axapta,
dynamics Ax,
fieldid,
fieldname2id
AX2009 How to get XML from site using proxy
xml TNC_getXML()
{
System.Net.HttpWebResponse httpresponse;
System.Net.WebRequest webrequest;
System.Net.WebResponse webResponse;
System.Net.HttpWebRequest httprequest;
System.Net.IWebProxy proxy;
System.Net.WebPermission webPermission;
System.IO.Stream stream;
System.IO.StreamReader streamreader;
System.Text.Encoding encoding;
xml xml;
interopPermission interopPermission;
int i;
interopPermission = new InteropPermission(InteropKind::ClrInterop);
InteropPermission.assert();
try
{
webrequest = System.Net.WebRequest::Create("../../...xml");
proxy = System.Net.WebRequest::GetSystemWebProxy();
proxy.set_Credentials(System.Net.CredentialCache::get_DefaultCredentials());
webRequest.set_Proxy(proxy);
httpresponse = webRequest.GetResponse();
stream = httpresponse.GetResponseStream();
streamreader = new System.IO.StreamReader(stream);
xml = streamreader.ReadToEnd();
codeAccessPermission::revertAssert();
}
catch
{
error("Connection Error");
}
}
{
System.Net.HttpWebResponse httpresponse;
System.Net.WebRequest webrequest;
System.Net.WebResponse webResponse;
System.Net.HttpWebRequest httprequest;
System.Net.IWebProxy proxy;
System.Net.WebPermission webPermission;
System.IO.Stream stream;
System.IO.StreamReader streamreader;
System.Text.Encoding encoding;
xml xml;
interopPermission interopPermission;
int i;
interopPermission = new InteropPermission(InteropKind::ClrInterop);
InteropPermission.assert();
try
{
webrequest = System.Net.WebRequest::Create("../../...xml");
proxy = System.Net.WebRequest::GetSystemWebProxy();
proxy.set_Credentials(System.Net.CredentialCache::get_DefaultCredentials());
webRequest.set_Proxy(proxy);
httpresponse = webRequest.GetResponse();
stream = httpresponse.GetResponseStream();
streamreader = new System.IO.StreamReader(stream);
xml = streamreader.ReadToEnd();
codeAccessPermission::revertAssert();
}
catch
{
error("Connection Error");
}
}
Etiketler:
ax2009,
Axatpa,
code,
httprequest,
permission,
webrequest,
xml
Ax2009 Update object properties on AOT
static void tnc_updateTableLog(Args _args)
{
TreeNode aNode = TreeNode::findNode('\\Data Dictionary\\Tables').AOTfirstChild();
int i;
#Properties
str tproperties;
;
while (aNode)
{
tproperties = anode.AOTgetProperties();
tproperties = setproperty(tproperties, #PropertyCreatedBy,'Yes');
anode.AOTsetProperties(tproperties);
anode.AOTsave();
info(anode.AOTname());
aNode = aNode.AOTnextSibling();
i++;
// if (i>10) break;
}
}
{
TreeNode aNode = TreeNode::findNode('\\Data Dictionary\\Tables').AOTfirstChild();
int i;
#Properties
str tproperties;
;
while (aNode)
{
tproperties = anode.AOTgetProperties();
tproperties = setproperty(tproperties, #PropertyCreatedBy,'Yes');
anode.AOTsetProperties(tproperties);
anode.AOTsave();
info(anode.AOTname());
aNode = aNode.AOTnextSibling();
i++;
// if (i>10) break;
}
}
Ax conditional values on query range
Field name can be used in the range expression :
SysQuery::findOrCreateRange(this.query().dataSourceName(identifierstr(CustTrans)),fieldnum(CustTrans,SettleAmountCur)).value('(SettleAmountCur < AmountCur)');
SysQuery::findOrCreateRange(this.query().dataSourceName(identifierstr(CustTrans)),fieldnum(CustTrans,SettleAmountCur)).value('(SettleAmountCur < AmountCur)');
27 Mayıs 2010 Perşembe
27 Nisan 2010 Salı
Ax2009 How to get Enum Label
dictEnum = new dictEnum(dictionary.enumName2Id('ENUMNAME'));
info(strfmt("Enum Label: %1", dictEnum.label() ));
info(strfmt("Enum item Lable:%1", dictEnum.value2Label(VALUE) ));
info(strfmt("Enum Label: %1", dictEnum.label() ));
info(strfmt("Enum item Lable:%1", dictEnum.value2Label(VALUE) ));
6 Şubat 2010 Cumartesi
Ax2009 SSRS Report edit Error in VS 2008
If u get the error "Invalid URI: The format of the URI could not be determined " while editing Ax2009 SSRS reports in Visual Studio 2008 for the first time on Win 7, just check the "C:\Users\tunca\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup " folder exists with admin rights.
Thanks to Bala Murugan , saved my huge time...
Thanks to Bala Murugan , saved my huge time...
3 Ocak 2010 Pazar
Project Gemini
OLAP için arayüzmü arıyorsunuz.
MS Office 2010 u bekleyin.
Project Gemini hayli tatminkar bir kullanım vaadediyor...
MS Office 2010 u bekleyin.
Project Gemini hayli tatminkar bir kullanım vaadediyor...
Win2008 Server + SQL Server 2008 , Ax 2009 Reporting Service , Analysis Service kurulum hatası
Ax2009 u MS SQL2008 Server üzerinde kurarken Reporting Service kurulumunda
SQL Server 2005 SP2 or higher is required
hatası veriyor. Bu hatayı geçmek için
Ax2009 dosyaları DVD den bir klasöre kopyalanmalı
Ax2009 SP1 Setup -> Support -> AXSetupResources -> Microsoft.Dynamics.Setup. ReportingServices.dll dosyası
AX2009 Setup -> Msi -> Components32 -> Program Files -> Microsoft Dynamics AX -> 50-> Setup
ve
AX2009 Setup -> Msi -> Components64 -> Program Files -> Microsoft Dynamics AX -> 50-> Setup
klasöründeki aynı isimli dosya ile değiştirilmeli.
OLAP küplerini deploy etmek için SQL 2005 Analysis assembly dosyalarına ihtiyaç var.
http://support.microsoft.com/kb/936081/en-us
SQL Server 2005 SP2 or higher is required
hatası veriyor. Bu hatayı geçmek için
Ax2009 dosyaları DVD den bir klasöre kopyalanmalı
Ax2009 SP1 Setup -> Support -> AXSetupResources -> Microsoft.Dynamics.Setup. ReportingServices.dll dosyası
AX2009 Setup -> Msi -> Components32 -> Program Files -> Microsoft Dynamics AX -> 50-> Setup
ve
AX2009 Setup -> Msi -> Components64 -> Program Files -> Microsoft Dynamics AX -> 50-> Setup
klasöründeki aynı isimli dosya ile değiştirilmeli.
OLAP küplerini deploy etmek için SQL 2005 Analysis assembly dosyalarına ihtiyaç var.
http://support.microsoft.com/kb/936081/en-us
31 Aralık 2009 Perşembe
Dynamics Ax Servisi atama
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.
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.
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)