Senin, 04 April 2011

lookup berdasarkan Parameter-nya


spAXrrttaaaaaaaaaaaaann!! ...

Method Lookup disini adalah sebuah method yang banyak dipakai dalam membangun/mengubah Applikasi di Microsoft Dynamics Ax ...

public void lookup()
{
//Lookup AttachmentCode berdasarkan TaxTrans
Query query = new Query();
QueryBuildDataSource queryBuildDataSource;
QueryBuildRange queryBuildRange;
// Create an instance of SysTableLookup where 'this' the current Form control.
SysTableLookup sysTableLookup = SysTableLookup::newParameters(tableNum(IBMTaxAttachment), This);
;
// The field to be shown in the lookup form.

sysTableLookup.addLookupField(fieldNum(IBMTaxAttachment, IBMTaxAttachmentCode));
sysTableLookup.addLookupField(fieldNum(IBMTaxAttachment, Description));

// Limit and arrange data selection.
queryBuildDataSource = query.addDataSource(tableNum(IBMTaxAttachment));
queryBuildRange = queryBuildDataSource.addRange(fieldNum(IBMTaxAttachment, IBMTaxTransCode));

queryBuildRange.value(Grid1_IBMTaxTransCode.valueStr());
sysTableLookup.parmQuery(query);
// Perform lookup
sysTableLookup.performFormLookup();
}

Tidak ada komentar:

Posting Komentar

Erorr CS1963 - An expression tree may not contain a dynamic operation.

Kali ini saya mendapatkan erorr dengan code CS1963, padahal sebelumnya saya sudah mendefinisikan 'var item in Model' di @foreach(var...