Hi Zain thanks for the reply.
i am following this approach
i have created two classes
First DataContract Class which has Class Declaration and ParmRecordId methods.
Code for ParmRecordId :-
[DataMemberAttribute('RecordId')]
public recId parmRecordId(recId _recordId = recordId)
{
recId ret;
ret = super(_recordId);
return ret;
}
Second Dataprovider Class which has Class Declaration,getDataTmp and processReport method.
Code For processReport :-
public void processReport()
{
om_CostOfGoodsContract contract = this.parmDataContract() as om_CostOfGoodsContract;
RecId recId = contract.parmRecordId();
VendInvoiceTrans vendInvoiceTrans;
VendInvoiceJour vendInvoiceJour;
goodsCostingTmp localgoodsCostingTmp;
RecordSortedList recordList;
localgoodsCostingTmp = goodsCostingTmp::findRecId(recId);
while select vendInvoiceTrans join vendInvoiceJour
where vendInvoiceTrans.RecId == recId &&
// vendInvoiceTrans.PurchID == 'PO-002286' &&
vendInvoiceTrans.InvoiceId == vendInvoiceJour.InvoiceId
{
//clear the temporary table
goodsCostingTmp.clear();
//records from vendinvoicetrans
goodsCostingTmp.InvoiceId = vendInvoiceJour.InvoiceId;
goodsCostingTmp.InvoiceAccount = vendInvoiceJour.InvoiceAccount;
goodsCostingTmp.InvoiceAmount = vendInvoiceJour.InvoiceAmount;
goodsCostingTmp.InvoiceAmountMST = vendInvoiceJour.InvoiceAmountMST;
// records from vendInvoiceTrans
goodsCostingTmp.PurchID = vendInvoiceTrans.PurchID;
goodsCostingTmp.Name = vendInvoiceTrans.Name;
goodsCostingTmp.ItemId = vendInvoiceTrans.ItemId;
goodsCostingTmp.LineAmount = vendInvoiceTrans.LineAmount;
goodsCostingTmp.LineAmountMST = vendInvoiceTrans.LineAmountMST;
goodsCostingTmp.CurrencyCode = vendInvoiceTrans.CurrencyCode;
goodsCostingTmp.DeliveryName = vendInvoiceTrans.DeliveryName;
goodsCostingTmp.InternalInvoiceId = vendInvoiceTrans.InternalInvoiceId;
goodsCostingTmp.InvoiceDate = vendInvoiceTrans.InvoiceDate;
goodsCostingTmp.OrigPurchId = vendInvoiceTrans.OrigPurchId;
goodsCostingTmp.PriceUnit = vendInvoiceTrans.PriceUnit;
goodsCostingTmp.Qty = vendInvoiceTrans.Qty;
//insert data
goodsCostingTmp.insert();
}
}
I tried to Debug the Code the DataContract Class is reading RecID but i am facing error while reading the RecId in ProcessReport Method.
Thanks.
Regards.