How get delivery reminder in Excel sheet in ax 2012r3 ?

Hi Experts ,

How we will get the delivery reminder field value in Excel sheet in ax 2012r3

I am creating sales order useing sales quotation .

I have one field called balance against PPAP Qty :

Path for delivery reminder field :-so lines >> Updatelines >>delivery Remainder field .

private void run()

{

CommaIo io;

Dialog dialog;

DialogField dlgFileName;

Filename csvfileName;

FileIOPermission permission;

int recordCount = 0;

int i=0;

String20 quotaionJourId;

int strLength;

AccountNum accountNum;

SalesTaker pesron;

int j;

utcDateTime Crddate;

SysOperationProgress exportprogress = new SysOperationProgress();

#File

#AviFiles

try

{

exportprogress.setCaption(“Exporting quotation lines to CSV file…”);

exportprogress.setAnimation(#AviTransfer);

// Header Column

conHeader = [“CUSTOMER NAME”,“PART NO”,“PART DETAILS”,“PRICE”,“QUOTATION NO”,“CARD ISSUED DATE”,“CRD DATE” ," crd date", “PPAP QTY”,“TOTAL PPAP VALUE”,“DISPATCH QTY”,“DISPATCH VALUE”,“BALANCE AGAINST PPAP QTY”,“DISPATCH QTY per DATE”,“Remarks”];

dialog = new Dialog(“Exporting quotation lines”);

dialog.filenameLookupFilter([“Excel Files”,"*.csv"]);

dlgFileName = dialog.addField(extendedTypeStr(FilePath),“File Path”);

queryRun = new QueryRun(queryStr(PC_PPAPCard));

if(dialog.run())

{

csvfileName = strFmt(@"%1%2%3_%4.csv",dlgFileName.value(), “PPAP Details”, date2str(today(),321,2,0,2,0,4),strRem(time2Str(timeNow(), TimeSeparator::Colon, TimeFormat::Hour24), “:”));

if(csvfileName)

{

permission = new FileIOPermission(csvfileName,#io_write);

permission.assert();

io = new CommaIo(csvfileName,#io_write);

io.inFieldDelimiter(’,’);

if(!io || io.status() != IO_Status::Ok)

{

throw error(“Error in opening file!”);

}

io.writeExp(conHeader);

if(queryRun.prompt())

{

while( queryRun.next())

{

custQuotationJour = queryRun.get(tableNum(CustQuotationJour));

custQuotationTrans = queryRun.get(tableNum(CustQuotationTrans));

inventtable = queryRun.get(tableNum(InventTable));

salesQuotationLine = queryRun.get(tableNum(SalesQuotationLine));

salesQuotationTable = queryRun.get(tableNum(salesQuotationTable));

custTable = CustTable::find(custQuotationJour.InvoiceAccount);

inventTable = InventTable::find(custQuotationTrans.ItemId);

select ExternalItemID from custVendExternalItem

where custVendExternalItem.CustVendRelation == custQuotationJour.OrderAccount

&& custVendExternalItem.ModuleType == 4

&& custVendExternalItem.ItemId == inventTable.ItemId;

select InvoiceAmount from CustInvoiceJour

where CustInvoiceJour.SalesId == CustQuotationJour.SalesId;

if (custQuotationJour.PC_QuotationStage == PC_ItemStage::PPAP)

{

conQuotationData = [ custQuotationJour.OrderAccount,// 1 customer Name

custVendExternalItem.ExternalItemId,// 2 part no

inventTable.itemName(),// 3 part name

custQuotationTrans.SalesPrice,// 4 price

custQuotationTrans.quotationDocNum(),//5 quotation number

custQuotationJour.QuotationDate,// 6 card issue date

salesQuotationTable.createdDateTime,//7 CRD DATE

custQuotationTrans.Qty,// 8 PPAP Qty

CustQuotationTrans.lineAmountInclTax(), // 9 Total PPAP Value

CustInvoiceJour.InvoiceAmount,// 11 dispatch value

salesquotationline.PC_SpecialRemarks// 14 remarks

];

io.writeExp(conQuotationData);

}

}

CodeAccessPermission::revertAssert();

info(strFmt(“Report generated and saved. Path: %1”, csvfileName));

}

else

{

info(“Invalid file name specified!”);

}

}

}

}

catch(Exception::Error)

{

throw error(“Erorr in exporting journal lines.”);

}

}

Please suggest me …

You can get the salesLine from CustQuotationTrans by using Tables\CustQuotationTrans\Methods\salesLine
After having the salesLine, then it would be \Data Dictionary\Tables\SalesLine\Fields\RemainInventPhysical (or) \Data Dictionary\Tables\SalesLine\Fields\RemainSalesPhysical depending on Your requirement
RemainInventPhysical - is delivery reminder in inventory unit.
RemainSalesPhysical - is delivery reminder in sales unit.

HI Kranthi, stil i am unable to get the “Remainsalesphysical” value in the excel.

I really thankful if give me the code .

select * from custInvoiceTrans

where custInvoiceTrans.InventTransId == CustQuotationTrans.InventTransId

join custInvoiceTrans where custInvoiceTrans.SalesId == salesTable.SalesId

&& custInvoiceTrans.ItemId == SalesLine.ItemId;

// for Remain sales physical

select sum(RemainSalesPhysical) from SalesLine

where SalesLine.ItemId == salesQuotationLine.ItemId

join salesTable where salesTable.QuotationId == salesQuotationLine.QuotationId

&& salesTable.SalesId == SalesLine.SalesId;

conQuotationData = [ CustTable::find(custQuotationJour.OrderAccount).name(),// 1 customer Name

custVendExternalItem.ExternalItemId,// 2 part no

custVendExternalItem.ExternalItemTxt,// 3 part Name

// inventTable.itemName(),// 3 part name

custQuotationTrans.SalesPrice,// 4 price

custQuotationTrans.quotationDocNum(),//5 quotation number

custQuotationJour.QuotationDate,// 6 card issue date

//salesQuotationTable.createdDateTime,//7 CRD DATE

DateTimeUtil::date(DateTimeUtil::applyTimeZoneOffset(Crddate,

DateTimeUtil::getUserPreferredTimeZone())),

custQuotationTrans.Qty,// 8 PPAP Qty

custQuotationTrans.lineAmountInclTax(), // 9 Total PPAP Value

custInvoiceTrans.Qty,// 10 dispatch qty

custInvoiceTrans.lineAmountInclTax(),// 11 dispatch value

salesLine.RemainSalesPhysical,//12 BALANCE AGAINST PPAP QTY

salesline.PriceUnit * salesline.RemainSalesPhysical,//BALANCE AGAINST PPAP VALUE

custQuotationTrans.PwC_SpecialRemarks// 14 remarks

];

It seems you are exporting data for every custQuotationTrans record. If so, you can use the below code
salesLine = custQuotationTrans.salesLine();