Discussion:
How to update a Sales Quotation from X++?
(too old to reply)
RLP
2010-10-01 13:58:03 UTC
Permalink
From Ax2009, how can I update the quotation status (to sent, confirmed,
cancelled, lost)?

I've searched in Internet and AOT for something similar to the class that
can be used to update sales orders:

salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice);
salesFormLetter.update(
_salesTable, //SalesTable record to be posted
systemDateGet(), //Transaction date
SalesUpdate::All, //Which qty should be used
AccountOrder::None,
NoYes::No, //Is document a proforma
NoYes::No); //Should document be printed

Thanks in advance!!
--
RLP
RLP
2010-10-04 04:50:03 UTC
Permalink
At last, I had to create my own methods. I share them with you:

To send or confirm a Quotation:

Code:

//Based in SalesQuotationEditLinesForm::mainOnServer
private void updateToConfirmSent(DocumentStatus _documentStatus)
{
SalesQuotationEditLinesForm salesQuotationEditLinesForm;
ParmId parmId;
;
if (! salesQuotationTable) return;

salesQuotationEditLinesForm =
SalesQuotationEditLinesForm::construct(_documentStatus); //DocumentStatus
Quotation o Confirm
parmId = salesQuotationEditLinesForm.parmId();


salesQuotationEditLinesForm.initParmSalesQuotationTable(salesQuotationTable);

salesQuotationEditLinesForm.parmId(parmId);
salesQuotationEditLinesForm.parmTransDate(systemdateget());

salesQuotationEditLinesForm.prePromptInit();


salesQuotationEditLinesForm.initParameters(NoYes::No, //printFormletter,
NoYes::No,
//transferHours2Forecast,
NoYes::No,
//transferExpenses2Forecast,
NoYes::No,
//transferFees2Forecast,
NoYes::No,
//transferItems2Forecast,
'Sin razón alguna',
//reasonCode,
NoYes::No);
//usePrintManagement)
salesQuotationEditLinesForm.run();
}



To cancel or loose a Quotation, it's far away much simpler:

Code:

void updateTo(SalesQuotationStatus _salesQuotationStatus)
{
SalesQuotationUpdate salesQuotationUpdate;
;
salesQuotationUpdate =
SalesQuotationUpdate::constructFromSalesQuotationTable(salesQuotationTable,
_salesQuotationStatus);
SalesQuotationUpdate.run();
}
--
RLP
Loading...