Sometimes you can get this error:
Description: CIL generation: The given key was not present in the dictionary.
Path: \XppIL
Line: 1
Method/Property: XppIL
Error: Err:351
Sync DataDictionary and remove all errors at AOT.
Down AOS. Delete all files from this directory except subfolders:
C:\Program Files\Microsoft Dynamics AX\60\Server\AX2012R2_Dev\bin\XppIL
8 Ağustos 2014 Cuma
5 Ağustos 2014 Salı
AX 2012 - Add defaultdimension control to form
You can look for LedgerJournalTable form for how to do.
Add a relation with DimensionAttributeValueSet table's RecId field for which field added from DimensionDefault EDT.
Add a tab page named tabFinancialDimensions and change properties like below:
AutoDeclaration = true
caption = @SYS101181
HideIfEmpty = No
NeedPermission = Manual
Add this line to forms classDeclaration method:
DimensionDefaultingController dimensionDefaultingController;
Add this code part to forms init method:
public void init()
{
boolean allowEdit = true;
super();
dimensionDefaultingController = DimensionDefaultingController::constructInTabWithValues(false, true, allowEdit, 0, this, tabFinancialDimensions, "@SYS101181");
dimensionDefaultingController.parmAttributeValueSetDataSource(MyTable_ds, fieldStr(MyTable, DefaultDimension));
dimensionDefaultingController.parmValidateBlockedForManualEntry(true);
}
Add this method to tab page:
public void pageActivated()
{
dimensionDefaultingController.pageActivated();
super();
}
Update table data source methods like below:
public void delete()
{
super();
DimensionDefaultingController.deleted();
}
public void write()
{
ttsBegin;
DimensionDefaultingController.writing();
super();
ttsCommit;
}
public int active()
{
int ret;
ret = super();
DimensionDefaultingController.activated();
return ret;
}
Add a relation with DimensionAttributeValueSet table's RecId field for which field added from DimensionDefault EDT.
Add a tab page named tabFinancialDimensions and change properties like below:
AutoDeclaration = true
caption = @SYS101181
HideIfEmpty = No
NeedPermission = Manual
Add this line to forms classDeclaration method:
DimensionDefaultingController dimensionDefaultingController;
Add this code part to forms init method:
public void init()
{
boolean allowEdit = true;
super();
dimensionDefaultingController = DimensionDefaultingController::constructInTabWithValues(false, true, allowEdit, 0, this, tabFinancialDimensions, "@SYS101181");
dimensionDefaultingController.parmAttributeValueSetDataSource(MyTable_ds, fieldStr(MyTable, DefaultDimension));
dimensionDefaultingController.parmValidateBlockedForManualEntry(true);
}
Add this method to tab page:
public void pageActivated()
{
dimensionDefaultingController.pageActivated();
super();
}
Update table data source methods like below:
public void delete()
{
super();
DimensionDefaultingController.deleted();
}
public void write()
{
ttsBegin;
DimensionDefaultingController.writing();
super();
ttsCommit;
}
public int active()
{
int ret;
ret = super();
DimensionDefaultingController.activated();
return ret;
}
Etiketler:
AX,
ax 2012,
AXAPTA,
defaultdimension,
form
4 Ağustos 2014 Pazartesi
AX 2012 - SSRS How to suppress zero as blank?
Put this instead of put field (At this time PurchPrice) itself:
=IIF(Fields!PurchPrice.Value = 0 ,"",Fields!PurchPrice.Value)
=IIF(Fields!PurchPrice.Value = 0 ,"",Fields!PurchPrice.Value)
17 Temmuz 2014 Perşembe
AX 2012 - When Developing SSRS Report, if Visual Studio Table Window Disappears?
View->Report Data
AX 2012 - My New Field's Value Disappearing when Editing VendInvoiceInfoTable
I add a new field to VendInvoiceInfoTable When try to edit with VendEditInvoice
form I saw my new field's value is empty. After a long research I found out Axapta copy source record to another record and edit this new record. Meanwhile Axapta skips my new field. Axapta uses table method copyFromHeader while copying. Add my new line:
this.VendorRequestedWorkerEmail = _header.VendorRequestedWorkerEmail;
//my new field
this.myNewField = _header.myNewField;
Problem overed. Same method valid for related VendInvoiceInfoLine table too.
this.VendorRequestedWorkerEmail = _header.VendorRequestedWorkerEmail;
//my new field
this.myNewField = _header.myNewField;
Problem overed. Same method valid for related VendInvoiceInfoLine table too.
Etiketler:
AX,
ax 2012,
AXAPTA,
cannot,
disappear,
lost,
new field,
update,
value,
vendinvoiceinfotable
AX - 2012 What Comes Instead of TypeId?
You'll see TypeId doesn't work at AX 2012. Instead of that AX 2012'de you may use EnumStr for enums and diğer ExtendedTypeStr for other data types.
11 Temmuz 2014 Cuma
AX 2012 - Send marked records to SSRS RDP Report
SSRS DP Class don't accept table or container data types as parm method. I searched at forums and saw str data type adviced. But I think this's not best approach. At last learned best way already in standard AX SSRS reports. At this link there's a PDF file tells look for check report. I generated this report with look form ChequeDP and ChequeController classes:
Controller class:
class declaration:
class myController extends SrsReportRunController
{
#define.ReportName('myreport.Report')
myTMPTable myTMPTable;
}
public static void main(Args _args)
{
SysLastValue SysLastValue;
myController controller = new myController();
controller.parmReportName(#ReportName);
controller.parmArgs(_args);
controller.DeleteTmpData();
controller.init();
controller.startOperation();
}
protected void prePromptModifyContract()
{
SrsTmpTblMarshallerContract contract = this.parmReportContract().parmRdpContract() as SrsTmpTblMarshallerContract;
new SRSReportRunPermission().assert();
contract.parmTmpTableDataRecId(SRSTmpTblMarshaller::SendTmpTblToDataProvider(myTMPTable));
}
public void init()
{
FormDataSource ds;
TransDate transDate;
VendTrans vendTrans;
if (!this.parmArgs() ||
!this.parmArgs().record() ||
this.parmArgs().dataset() != tableNum(VendTrans))
throw error("Report should be call with correct parameter!..");
ds = this.parmArgs().record().dataSource();
vendTrans = ds.getFirst(1);
transDate = vendTrans.transDate;
PaymentReceipt.VendAccount = vendTrans.AccountNum;
for (vendTrans = ds.getFirst(1); vendTrans != null; vendTrans = ds.getNext())
{
myTMPTable.Date = vendTrans.TransDate;
...
myTMPTable.insert();
}
}
DP Class:
// <ETG - memre > GN: T: 11.07.2014 A:
[SRSReportParameterAttribute(classStr(SrsTmpTblMarshallerContract))]
public class mpDP extends SRSReportDataProviderBase
{
myTMPTAble myTMPTable;
}
private void initTmpTable()
{
SrsTmpTblMarshallerContract contract = this.parmDataContract() as SrsTmpTblMarshallerContract;
new SRSReportRunPermission().assert();
myTMPTable = SRSTmpTblMarshaller::getTmpTbl(contract.parmTmpTableDataRecId());
SRSTmpTblMarshaller::deleteTmpTblData(contract.parmTmpTableDataRecId());
CodeAccessPermission::revertAssert();
}
public void processReport()
{
CompanyInfo Company;
VendTable vendTable;
AmountMST amount;
TempStr NumtoTxt;
LedgerJournalTrans LedgerTrans;
this.initTmpTable();
...
}
Controller class:
class declaration:
class myController extends SrsReportRunController
{
#define.ReportName('myreport.Report')
myTMPTable myTMPTable;
}
public static void main(Args _args)
{
SysLastValue SysLastValue;
myController controller = new myController();
controller.parmReportName(#ReportName);
controller.parmArgs(_args);
controller.DeleteTmpData();
controller.init();
controller.startOperation();
}
protected void prePromptModifyContract()
{
SrsTmpTblMarshallerContract contract = this.parmReportContract().parmRdpContract() as SrsTmpTblMarshallerContract;
new SRSReportRunPermission().assert();
contract.parmTmpTableDataRecId(SRSTmpTblMarshaller::SendTmpTblToDataProvider(myTMPTable));
}
public void init()
{
FormDataSource ds;
TransDate transDate;
VendTrans vendTrans;
if (!this.parmArgs() ||
!this.parmArgs().record() ||
this.parmArgs().dataset() != tableNum(VendTrans))
throw error("Report should be call with correct parameter!..");
ds = this.parmArgs().record().dataSource();
vendTrans = ds.getFirst(1);
transDate = vendTrans.transDate;
PaymentReceipt.VendAccount = vendTrans.AccountNum;
for (vendTrans = ds.getFirst(1); vendTrans != null; vendTrans = ds.getNext())
{
myTMPTable.Date = vendTrans.TransDate;
...
myTMPTable.insert();
}
}
DP Class:
// <ETG - memre > GN: T: 11.07.2014 A:
[SRSReportParameterAttribute(classStr(SrsTmpTblMarshallerContract))]
public class mpDP extends SRSReportDataProviderBase
{
myTMPTAble myTMPTable;
}
private void initTmpTable()
{
SrsTmpTblMarshallerContract contract = this.parmDataContract() as SrsTmpTblMarshallerContract;
new SRSReportRunPermission().assert();
myTMPTable = SRSTmpTblMarshaller::getTmpTbl(contract.parmTmpTableDataRecId());
SRSTmpTblMarshaller::deleteTmpTblData(contract.parmTmpTableDataRecId());
CodeAccessPermission::revertAssert();
}
public void processReport()
{
CompanyInfo Company;
VendTable vendTable;
AmountMST amount;
TempStr NumtoTxt;
LedgerJournalTrans LedgerTrans;
this.initTmpTable();
...
}
Kaydol:
Kayıtlar (Atom)